Ericsson Interview Question for Developer Program Engineers


Team: ruby on rails
Country: India
Interview Type: Written Test




Comment hidden because of low score. Click to expand.
0
of 0 vote

Factories create full-featured objects, but fixtures do not

- sam November 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It's not correct!!!!

- Nata November 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Factories keep tests independent, while fixtures may not

- CD November 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

this one is correct

- Anonymous February 08, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I agree that "Factories keep tests independent, while fixtures may not" is correct.

From the SaaS book:

A fixture is a fixed state used as a baseline for one or more tests. The term fixture comes from the manufacturing world: a test fixture is a device that holds or supports the item under test. Since all state in Rails SaaS apps is kept in the database, a fixture file defines a set of objects that is automatically loaded into the test database before tests are run, so you can use those objects in your tests without first setting them up.

Unless used carefully, fixtures can interfere with tests being Independent, as every test now depends implicitly on the fixture state, so changing the fixtures might change the behavior of tests. In addition, although each individual test probably relies on only one or two fixtures, the union of fixtures required by all tests can become unwieldy. For this reason, many programmers prefer to use a factory—a framework designed to allow quick creation of full-featured objects (rather than mocks) at testing time.

- Anonymous August 10, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More