Importance of Testing From Developer's Point of View
The developer also should understand the processes that should be considered when developing to make the software totally reliable.
Join the DZone community and get the full member experience.Join For Free
nowadays our world is totally computerized, everywhere there is software that plays a major role and makes things simple. so it's every developer's responsibility to develop software that is reliable and of course has zero defects. even the testing people play a major process in testing but the developer also should understand the processes that should be considered when developing to make the software totally reliable.
testing for developers
testing is the process of executing a program or system with the intent of finding errors and it will systematically uncover various classes of errors in a minimum amount of time and with a minimum amount of effort.
testing shows that the software appears to be working as stated in the specifications and the data collected using testing can also provide an indication of the software's reliability and quality. also it cannot show the absence of a defect, it can only show whether software defects are present.
testing is an activity that must be done during the software development cycle prior to the release into production as the process of demonstrating that defects are not present. and the process of showing that a program performs all the intended functions correctly before being released into production.
testing is the process of establishing confidence that a program does what it is supposed to do and during the maintenance cycle of the software, testing is still extremely important and needs to be done every time the software is modified.
quality assurance refers to the set of planned and systematic set of activities that ensure processes in the organization meet certain standards like iso 9000 or sei cmm that provide a certain degree of confidence in the quality of the software being released.
quality assurance activity
setting and maintaining guidelines for processes in line with international standards, performing internal audits to ensure adherence to procedures and so on are some of the qa activities but studying software specifications, developing test plans, test cases, executing tests, creating automated test scripts and reporting defects are some of the testing activities.
validation and verification in testing
verification refers to the set of activities that ensure that software correctly implements a specific function, imposed at the start of that phase and here some activities are done at each and every stage of the software development cycle using requirements analysis, design, coding and so on.
validationvalidation refers to a different set of activities that ensure that the software that has been built is traceable to customer requirements and activities are typically activities done once the coding has been completed to verify that the software adheres to functional requirements.
when to do testing
testing activities can be started as soon as the srs has been prepared where test planning can be initiated and progressed along with the sdlc through the design and coding phases by developing test designs and test cases as soon as the coding is completed, the focus can be on "test execution" .
this approach of testing early in the sdlc will contribute to meeting deadlines without compromising the testing activities.
there are several types of testing, they are:
- white box testing
- black box testing
- v-model testing
- unit testing
- acceptance testing
- integration testing
- acceptance testing
- load/stress testing
- soak testing
- smoke testing
- volume testing
- concurrency testing
- regression testing
white box testing
white box testing is testing the application at the code level. this is the structural or logic driven testing on the source code of the application, to ensure:
- memory leakage
- code complexity
- code review
- code coverage
white box or glass box tests is the structural testing that is based on the knowledge of the internal structure and the logic and it is usually logic driven.
white box testing is a test case design method that uses the control structure of the procedural design to derive test cases. test cases can be derived that:
- guarantee that all independent paths within a module have been exercised at least once
- exercises all the logical decisions on their true and false sides
- executes all loops at their boundaries and within their operational bounds
- exercises internal data structures to ensure their validity
memory leak test techniques focus on the execution of the application that attempt to find instances where the application is not releasing or freeing up allocated memory. this test technique is valuable in program debugging as well as in testing a complete software release.
a memory leak is present wherever a program fails to free allocated memory. it allocates then allocates more to replace the memory it already has. memory leaks are the most common type of defect but difficult to detect. errors can be identified before they cause major problems like performance degradation or a dead lock condition.
code complexity aids in identifying complex areas and aids in evaluating the maintainability and reliability of modules.
code review is used to assist in a static review of code against coding standards set within the organization.
code coverage identifies the level of the code covered in testing. it looks for branch coverage and instruction coverage and gives the % of the code that has been covered. it is a useful metric that could be a measure of the extent of testing that has been done.
black box testing
data-driven testing to ensure an application's functionality meets the requirements specification and the application gets input and the expected outputs are known, but the contents / program code is not known or irrelevant. some techniques are:
- test grouping/ equivalence classes
- boundary analysis
- worst case analysis
black box testing is functional testing based on external specifications without knowledge of how the system is constructed usually process and/or data driven. it attempts to derive sets of inputs that will fully exercise all the functional requirements of a system. it is not an alternative to white box testing.
black box testing attempts to find errors in the following categories.
- incorrect or missing functions
- interface errors
- errors in data structures or external database access
- performance errors
- initialization and termination errors
equivalence classes may be defined depending on the following guidelines:
- if an input condition specifies a range, one valid and two invalid equivalence classes are defined.
- if an input condition specifies a member of a set, then one valid and one invalid equivalence class is defined.
- if an input condition is boolean then one valid and one invalid equivalence class is defined.
boundary value analysis
bva can be applied to both structural and functional testing levels. it defines the three types of data good, bad and on the border and uses values that lie on the boundary and maximum/minimum values. its analysis always include plus/minus one boundary values.
bva leads to a selection of test cases that exercise boundary values. it complements equivalence partitioning since it selects test cases at the edges of a class. rather than focusing on input conditions solely, bva derives test cases from the output domain also.
cause-effect graphing techniques
cause-effect graphing is a technique that provides a concise representation of logical conditions and corresponding actions. there are the following four steps:
- causes (input conditions) and effects (actions) are listed for a module and an identifier is assigned to each.
- a cause-effect graph is developed.
- the graph is converted to a decision table.
- decision table rules are converted to test cases.
v-model testing is the most widely recognized model for conducting software testing. it tracks the development cycle and associated testing tasks at each phase. it consists of unit testing, integration testing, system testing and acceptance testing that based on the way the software is built.
unit testing involves testing the smallest unit or block of code. a software unit is defined as a collection of code segments that make up a module or function. a unit can be the screens for a gui application, be the smallest block of code for embedded / system level software. for gui applications let us see what constitutes unit testing.
unit testing for gui application comprises:
- verifying field level validations (for example a name field should accept only a string, an age field only a numeric between 1 and 100 and so on)
- application logic (for example interest rate calculations and insurance premium calculations based on input data in that unit)
- gui/cosmetic issues (for example size and position of windows, bitmap size, size and position of the form)
integration testing tests the application as a whole, while identifying the problems with program communication. it should be done to test the interface among the modules or units. database updating as well as the functional problems that are not found by the unit testing are identified in integration testing.
acceptance testing is testing the system as a whole to ensure that it meets the stated business requirements. very often done by the customer. it is a type of testing to test whether it works within the defined constraints that ensure that the system meets the needs of the organization and the end user/customer to validate that the right system was built.
load testing is testing the software at anticipated load levels for the purpose of identifying problems in resource contention, response times and so on.
in stress testing a considerable load is generated as quickly as possible to stress the application and analyze the maximum limit of concurrent users the application can support.
soak testing involves loading the application with concurrent users over a period of time to study application performance parameters.
smoke test focuses on test automation of the system components that make up the most important functionality. instead of repeatedly re-testing everything manually whenever a new software build is received, smoke test is used to verify the major functionality of the system.
the script will automatically walk through each step that the test engineer would otherwise have done manually. a smoke test ensures that no effort is wasted in trying to test an incomplete build.
volume testing tests the performance and behavior of software under a large volume of data in the database. in volume testing, application response time and general performance parameters can be checked.
concurrency testing is the execution of a task with the purpose of finding the errors due to the simultaneous input, concurrent resource access and program communication.
occurrence of deadlocks at the database layer due to simultaneous input can be tested for any scenario that demands testing for simultaneous input can be termed concurrency testing. for instance, when 20 users access a banking application simultaneously with the same username and password. only one of them should be allowed to login.
regression testing is the testing of software after a modification has been made to ensure the reliability of each software release. it's a process of testing after changes have been made to ensure that changes did not introduce any new errors into the system. it applies to systems in production undergoing change as well as to systems under development.
here the test data must be maintained and data conversion and data dependencies may be required when the tests cannot use previous versions of test data. the greater the difference between versions, the less effective the regression test. should maintain stable baseline version for comparisons.
tips for doing regression testing:
- control the scope of testing.
- build a reusable test bed of data.
- use automated tools.
- base the amount of regression testing on risk.
- build a repeatable and defined process for regression testing.
the following is how to track the defects:
- identify the test failure
- report the defect
- fix the problem
- analyze the problem
- reproduce the problem
- problem complete
Published at DZone with permission of Selva Ganapathy Kathiresan, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.