F7 Flashcards

1
Q

State-Based Testing

A

• Model functional behavior in a state machine (communication – protocol …)
• Select test cases in order to cover the graph
– Each node
– Each transition
– Each pair of transitions
– Each chain of transitions of length n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

States are Behavioral Modes

A

Three questions to detect/recognise states:

  1. AretherethingsIcandonowthatIcouldnot do before?
  2. AretherethingsIcannotdonowthatIcould do before?
  3. Willmyactionshavedifferentresultsnow than before?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State models (diagrams)/State tables

A
  • Statemodelspromptyoutoconsider(state) transitions.
  • Statetablespromptyoutoconsiderwhenyoucause events to occur outside the bounds of expected transitions.
  • Asaresult,statetablesareparticularlygoodfor discovering problems related to interruptions or unhandled transitions.
  • Considere.g.thereturnvalueforthe“invalidcases” in the table.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

All pairs

A

based on the observation that most faults are caused by
interactions of at most two factors.
– A method often used for testing of combinations of input is “All Pairs”. The method does not bother to analyse the logical dependencies (e.g. using Cause-Effect graphing), but tries to list test cases, that pair each value of each of the variables with each value of each other variable at least once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cyclomatic Complexity

A
Cyclomatic
number of test cases to fully cover a piece of code.
of the needed
Complexity can be used as an
indication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Condition coverage

A

To cover all conditions, we need to make sure that “each Boolean sub-expression has been evaluated both to true and false at least once”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Coverage-based Testing • Advantages

A
– Systematic way to develop test cases – Measurable results (the coverage)
– Extensive tool support
• Flow graph generators
• Test data generators
• Bookkeeping
• Documentation support
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Coverage-based Testing disadvantages

A

– Code must be available

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What Can’t White Box Tests Find?

A

• Bugsofomission
– Missing requirements, design elements, code
• Use requirements, design and code reviews • Unmaintainable code
– Inscrutable variable names or constructs, etc. • Use code reviews and static analysis tools
• Systemicproblems
– Performance, security, usability, interoperability, etc.
• Use code reviews, black-box system testing, beta/pilot tests, usability studies, prototyping, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Automated testing

A

unit testing should be automated so that tests are run and checked without manual intervention.
• With automated tests, the test suite can be rerun whenever there has been a change to the SW. One can then see if the new code has made any of the previously passing test cases to now fail.
• In automated unit testing, you make use of a test automation framework (such as Junit/NUnit) to write and run your program tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Test-Driven Development

A

is an approach to program development in which you inter-leave testing and code development.
• Tests are written before code and ‘passing’ the tests is the critical driver of development.
• You develop code incrementally, along with a test for that increment. You don’t move on to the next increment until the code that you have developed passes its test.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Benefits of test-driven development

A

Writing the test first, forces you to consider what the new code shall do. This often leads to better structured code (remember the “single responsibility principle”)
• Code coverage
– Every code segment that you write has at least one associated
test so all code written has at least one test.
• Regression testing
– A regression test suite is developed incrementally as a program is developed.
• Simplified debugging
– When a test fails, it should be obvious where the problem lies.
The newly written code needs to be checked and modified. • System documentation
– The tests themselves are a form of documentation that describe what the code should be doing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly