Test 3 Flashcards Preview

Software Engineering > Test 3 > Flashcards

Flashcards in Test 3 Deck (20):
1

Explain the purpose of a code repository

A code repository is essentially a version control tool, which allows users to make changes to existing source code in real-time, and without the hassle of traditional patches that the original source owner would need to evaluate. A repository is cloned to a local machine, changes are made, then the local copy is merged with the traditional if the changes are deemed acceptable.

2

Abstract Factory

Creational design pattern that essentially provides an interface for creating families of related, dependent objects without specifying their concrete classes.

3

Facade

A structural design pattern in which a singleton is the sole means for obtaining functionality from the package.

4

Factory Method

Creational design pattern that essentially defines an interface for creating an object, but it allows subclasses to decide which class to instantiate.

5

Strategy

A behavioral design pattern that essentially allows the definition of a family of algorithms, which are all interchangeable depending upon the client that uses them.

6

Explain the purpose of unit testing

Unit testing breaks an application into small, discrete, testable behaviors. This allows a developer to test these units, rather than attempting to test an entire application, which will probably have infinite paths and eventually evolve into something that cannot be appropriately tested.

7

Arrange

Setting up the environment, making sure all preconditions are met, selecting the input data, and determining the expected result.

8

Act

Applying the input data to the unit.

9

Assert

Comparing the actual result to the expected result.

10

Preconditions

A precondition is what is assumed to be true before the method is executed.

11

Postconditions

A postcondition is what is assumed to be true after the method is executed.

12

Assertion

An assertion is a statement that says something about the state of the unit. Assertions should be true.

13

Test class using MSTest

[TestClass]
public class ABankAccount

[TestMethod]
ShouldSetBalanceAndAnnualInterestRateWhenConstructed ( )

// Arrange, Act
var sut = new BankAccount (100.0m, 0.1m);

// Assert
Assert.AreEqual (100.0m, sut.Balance);
Assert.AreEqual (0.1m, sut.AnnualInterestRate);

14

Statement Coverage

Ensures all statements in the unit are executed at least once by at least one test case.

15

Branch Coverage

Ensures all branches in the unit are executed at lease once by at least one test case.

16

Predicate Coverage

Ensures all predicates in the unit are executed at least once by at least one test case.

17

All Path Coverage

Ensures that all path combinations in the unit are executed.

18

Explain what an equivalence partition is

Equivalence partitioning divides input values into equivalent groups. It is used to limit the number of test cases to something "reasonable."

19

Derive an equivalence partition from X and Y

(x and y, post), (not x and y, exception), (x and not y, exception), (not x and not y, exception)

20

Derive an equivalence partition from X or Y

(x, post), (y, post), (x and y, post), (not x and not y, exception)