Testing Strategies
Software Engineering 2017 Alessio Gambi - Saarland University
Testing Strategies Software Engineering 2017 Alessio Gambi - - - PowerPoint PPT Presentation
Testing Strategies Software Engineering 2017 Alessio Gambi - Saarland University Generic Testing Strategies Automate as much as possible Manual not necessary bad, automatic not necessary good Automate the right part of testing
Software Engineering 2017 Alessio Gambi - Saarland University
possibly the behavior of the environment at once
each test build incrementally, Randoop
whole test suite generation, Evosuite
distance) to define a fitness function
valid inputs to reach deeper parts of the code
structure to guide the input generation
Who provides the grammar? Can we learn it automatically?
brittle, dependent, and non-isolated tests
setup/teardown vs test execution vs verification
To make a single unit work, you often need other units
Object passed around but never used.
Working implementations with shortcuts.
Provide canned answers to calls during tests.
Objects pre-programmed with expectations on calls.
To make a single unit work, you often need other units
Gerard Meszaros
Martin Fowler
Stub Mock
In-memory structure for storing records Define data which will be written in the DB but not the logic to do it SUT reads and writes records to the stub DB SUT invokes mock, but no data are stored Check state of DB and behavior
Check what was written to DB and how values ended up there
specify the state before the test
specifies what to do during the test
specify the expected results after the test
might point to wrong decision
non-testable programs
float/doubles, asynchronous interaction, …
result is correct but it took hours to compute
test values or relationships
check results of current tests vs results of previous tests
embed the correct answer in the test data
check the calculations of a program using other programs
Apply the inverse function, check if result is same (neg)
test a software simulation of a physical process
unlikely (yet formally correct) behaviors
what the program does for each input in each state
how the SUT and the other programs behave in response to each other
test a software simulation of a physical process
unlikely (yet formally correct) behaviors
what the program does for each input in each state
how the SUT and the other programs behave in response to each other
Do not forget that models may be wrong !
What’s beyond functional correctness and coverage?
What’s beyond functional correctness and coverage?
What’s beyond functional correctness and coverage?
testing
adequacy criteria, test generation and execution, scaffolding, …
testing
adequacy criteria, test generation and execution, scaffolding, …
peculiar properties that must be taken into account during testing
environment, distribution, limited resources, interactivity, …
functionalities of application as per requirement specification
client application, server, and network performance
secure connections, encrypted data, data leakage
Acceptance Testing
incoming call, SMS, low memory/battery warning, …
installation process including update and uninstall
WiFI, 3G, 4G how switching network impacts on the application
developer runtime, emulator, real devices, cloud
capture&replay, monkey testing, …
performance slow down while using the app
how many items in the cart make my app unresponsive?
secure
different devices/connections/location
possibly untrustworthy, users
afterwards
not end up in “frustrating” the users
game not saved is lost, apps resume on home screen
Incoming notifications, text and calls, and memory/ battery warning interrupt the operation of the app
features/standards
4G to 1G, 1G to Edge, …
automated black-box tests
device profiles
there are many, many more
logic)
speeds, standard protocols, devices
server, between Web server and application server, and between application server and database
messages to users
transactions
as possible
break it; then, check if the system recovers.
disabled
sessions end
layout and interactions
Link Checkers, HTML Validators, Web Accessibility, Web Services, Cross-Browser, Web Functional/Regression Test, Web Site Security, …
http://www.softwaretestinghelp.com/most-popular-web-application-testing-tools/
write after read, read after write, write over write
difficult to predict and test
bare metal or inside virtual machines
configurations
vary the number of nodes
simulators, stubs, or doubles
hard to enumerate and foreseen
replicates that data asynchronously to all other nodes.
been successfully replicated.
node and all the other nodes. Therefore, tests need to pull the data from each node where the data supposedly lives.
store data in the system
which node? check that it is actually down
is the data up-to-date or the “best version” (all the data) retrieving data from the broken node must fail (not hang)
requires the ability to pull data from that particular node
deterministic execution order
perform sanity checks
tests on the model
state searches, pseudo-random activity, and timing variations
social network
user user
social network
user user
social network
user user
social network
user user
social network
user user
social network
user user
social network
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
Init Role Reply Role
Existing
init.C
Declined Retracted Accepted
reply.U init.D reply.D
Existing
init.C
Accepted Declined Retracted
init.D reply.D reply.U
not always possible!
do not use global state
timestamp, node ID, log levels, multiple sources
scheduling
dependency injections during testing
strategy/
gclid=CNrrjte2sNQCFekW0wodOroJTQ
applications/
tool/
tool/
best-in-android
www.softwaretestinghelp.com/web-application-testing/
browser-compatibility-testing-efforts/
deterministically-validated-by-tests