TU Wien:Software Testen VL (Winkler)/Prüfung 2010-06-24
Die Prüfung bestand aus acht Fragen, die ersten vier gehörten zum theoretischen, die letzten vier zum praktischen Teil.
Software Processes and Testing (5P)[Bearbeiten | Quelltext bearbeiten]
1a) Provide a brief definition of the term software testing (1P).
1b) Discuss the contribution of software testing in V-Model and Scrum. (hint: explain the contribution of testing by using small illustrations) (4p).
Testing and Traceability (4P)[Bearbeiten | Quelltext bearbeiten]
2a) Explain the term traceability and provide a basic classification of traceability approaches (1p).
2b) Explain briefly what aspects are relevant regarding software testing and traceability. (hint: apply software testing to every basic traceability class) (3p).
Model-Driven Testing (4p)[Bearbeiten | Quelltext bearbeiten]
3a) What is a model and how does a model contribute to model-driven testing (1p)
3b) Provide the basic workflow of model-driven testing (e.g., by illustrating the basic concept graphically) and discuss advantages and disadvantages of model-driven testing (3p).
Error -> Fault -> Failure (2p)[Bearbeiten | Quelltext bearbeiten]
Explain the terms error, fault and failure, provide an illustrative example and discuss the relationship between the individual aspects.
Coverage and Mutation Analysis (3p)[Bearbeiten | Quelltext bearbeiten]
// TODO: Graph
5a) What is the minimum number of test cases to cover all decisions (100% decision coverage)? Mark one of the following options (1P).
(The test gives the choice between one, two, three and four test cases)
5b) What is the minimum number of test cases required to cover all paths (100% path coverage)? Mark one of the following options (1P).
(The test gives the choice between one, two, three and four test cases)
5c) If mutation analysis is applied and each of the three statements is mutated, will it be possible to detect all mutants with 100% path coverage? Explain your answer briefly. (1p).
Equivalence Partitioning and Boundary Value Analysis (4p)[Bearbeiten | Quelltext bearbeiten]
/**
* Returns true if a student is permitted to take part in
* the exam. A student is only permitted if the following two
* conditions hold true: (1) The student attended the course
* and (2) the student achieved at least 35 points in exercises.
*
* @param points is the number of points achieved in exercises.
* @oaram attended is true if the student attended the course.
* @returns true if the student is permitted to the exam.
*/
boolean isPermitted( byte points, boolean attended);
Listing 1: Documentation and declaration of the function isPermitted
6a) Apply ""equivalence partitioning and boundary value analysis for the input parameters of the function shown in Listing 1. List all partitions you found including boundary values and mark invalid partitions (2P).
6b) Derive test cases from your equivalence partitions and boundary values for Listing 1, and report the test cases in the following table (2P). (Note: The number of rows is not necessarily the expected number of test cases!)
TC# | points | attented | result |
---|---|---|---|
Implementing Test Cases with xUnit (4p)[Bearbeiten | Quelltext bearbeiten]
Following listing shows test cases implemented with JUnit 4.
public class FileTest {
File f;
@Before
public void setUp() {
f = new File("test.txt");
assertTrue(f != null);
}
@Test
public void testFile01() {
assertTrue("Make sure the file exists", f.exists() );
}
@Test
public void testFile01() {
try {
FileWriter w = new FileWriter("test.txt");
for (int i = 0; i < 3; i++) {
w.write("test " + i + ", ");
}
w.close();
BufferedReader r =
new BufferedReader(new FileReader("test.txt"));
r.close();
r.readline(); // throws IOException cause file is closed
} catch (Exception e) {
assertTrue(true); // exception as expected
}
}
}
Listing 3: Examle JUnit 4 Tests.
7a) Are the test cases in Listing 2 unit tests? Explain your answer (1p).
7b) What problems do you identify in the implementation of the test cases in Listing 2? Report and explain any problems you found (3p).
(Note: The number of rows is not necessarily the expected number of problems!)
System Automation (4p)[Bearbeiten | Quelltext bearbeiten]
8a) Explain briefly the GUI testing approaches Capture&Replay and Script-based testing (1p).
8b) Consider following situation: You are hired as a lead tester by a company that started developing a medium-sized ERP-Application in Java. Every month a new version of the application is released. For every release a large number of improvements and bugfixes are scheduled. In addition, product management insists, that with every release, at least one new feature is introduced. A new version needs to be fully tested before it can be released. So far, testing has been done manually by a team of three testers. They where running about 200 test cases via the GUI of the application.
Now you are expected to automate testing with a commercial test tool the company had already licensed. The tool supports Capture & Replay as well as Scripting of test cases in Java. On the one hand, project management proposes to use Capture & Replay, on the other hand, the development lead, argues for script based testing.
Prepare a list of distinct benefits for each of the two options. Explain each benefit briefly. Document any additional assumptions you make.