Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These questions are regarding Unit Tests: For each of the following scenarios, identify the type of double which would be most useful. You would like

These questions are regarding Unit Tests: image text in transcribedimage text in transcribedimage text in transcribed

For each of the following scenarios, identify the type of double which would be most useful. You would like to create a special version of a class except that does not access certain expensive operations. You would like to monitor how a given variable or collections of variables are used in a given class. You would like to guarantee that a given class is never used in a certain method under test. There are three states required for a given test case. We want to make sure that these states and no others are utilized in the unit test. The class we commonly used to build other doubles from. You would like a special version of a class that only represents a single state - the state needed for a specific test case. Imagine a class representing a GPA. Identify the type of double from the example below: Double Stub Fake Dummy Mock Spy Imagine a class representing a GPA. Identify the type of double from the example below: class TestGPA : public GPA \{ private: int state; public: TestGPA() : state(0) \{\} double get () const { assert ( state ==1); state =2; return gpa; void set (double gpa) \{ assert(state==0);state=1;this->pa=gpa; \}; Dummy Fake Mock Stub Double Spy

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe the major socioemotional changes associated with aging.

Answered: 1 week ago