6.1. Testing
6.1. Testing
TESTING
The development of software systems involves a service of production activities where
opportunities for injection of human fallibilities are enormous. Errors may begin to occur at the
very inception of the process where the objectives may be erroneously or imperfectly specified,
as well as later design and development stages. Because of human inability to perform and
communicate with perfection, software companies are accompanied by a quality assurance
activity.
Software design is a critical element of software quality assurance and represents the
ultimate review of specification, design and code generation. Once source code has been
generated software must be tested to uncover as many as errors as possible before delivery to
the customer. Our goal is to design a series of test cases that have a high likelihood of finding
errors. To test the software, there are so many testing techniques which provide systematic
guidance for designing tests that exercise the internal logic of software components and
exercise the input and output domains of the program to uncover errors in program function,
behavior and performance.
If testing is conducted successfully, it will uncover errors in the software. As the secondary
benefits, testing demonstrates that software functions appear to be working according to
specification, that behavioral and performance requirements appear to have been met. The
software can be tested by one of the two ways: -
Knowing the specified function that a product has been designed to perform, tests can
be conducted that demonstrate each function is fully operational while at the same time
searching for errors in each function.
Knowing the internal working of the product, tests can be conducted to ensure that
internal operations are performed according to specifications and all internal
components have been adequately exercised.
The first approach is called white box testing and the second, black box testing.
White box testing is a test case design method that uses the control structural of the
procedural design to derive test cases. It is also called glass box testing. Using this method,
we can derive test cases that-
Guarantee that all independent paths within a module have been exercised at least
once.
Exercise all logical decisions on their true and false sides Executes all loops at their
boundaries and within their operational bounds.
Execute all loops at their boundaries and within their operational bounds.
Exercise internal data structures to ensure their validity.
White box testing requires access to the source code. Though white box testing can be performed
any time in the life cycle after the code is developed, it is a good practice to perform white box
testing during the unit testing phase.
6.2.2 .Black Box Testing
Black box testing focuses on the functional requirements of the software i.e. it enables the
software engineer to derive sets of input conditions that will fully exercise all functional
requirements for a program. It is also called behavioral testing.
only a small number of possible inputs can actually be tested, to test every possible input
stream would take nearly forever
without clear and concise specifications, test cases are hard to design
there may be unnecessary repetition of test inputs if the tester is not informed of test cases
the programmer has already tried
cannot be directed toward specific segments of code which may be very complex (and
therefore more error prone)
most testing related research has been directed toward glass box testing
A. Alpha Testing
The Alpha test is conducted at the developers site by a customer. The software
is used in a natural setting with the developer looking over the shoulder of the user
and recording errors and usage problem. Alpha test are conducted in controlled environment.
B. Beta Testing
The Beta-test is conducted at one or more customer sites by the end-user of the
software. Unlike Alpha testing, the developer is generally not present. Therefore, the Beta-
test is a live application of the software in an environment that cannot be controlled by
the developer. The customer records all problems ( real or imagined ) that are
encountered during Beta testing and reports there to the developer at regular intervals. As
a result of problems reported during Beta-tests, software engineers make modifications
and then prepare for release of the software product to the entire customer base.
In this project we will performed incremental testing in which components and subsystem
of the system are tested separately before integrating them to form the system from
system testing.
Designing effective test cases is important but so is the strategy we use to execute them. A
strategy for software test case design methods that result in the successful construction of
software. The strategy provides a road map that describes the steps to be conducted as a
part of testing.
There are a number of testing strategies, which have the following generic characteristics: -
Testing begins at the component level and works outward toward the integration
of the entire computerbased system.
Different testing techniques are approximate at different points in time.
Testing is conducted by the developer of the software and (for large projects) an
independent test group.
System testing
Validation testing
Integration testing
Unit testing
Code
Design
Requirements
System engineering
TESTING STRATEGY
Initially, system engineering defines the role of software and leads to software requirement
analysis where the information domain, function, behavior, performance, constraints and
validation criteria for software are established. Moving inward along the spiral, we come to
the design and finally to coding. There are a number of testing strategies, which are given
below: -
Unit testing
In the unit testing interfaces, local data structures, boundary conditions, independent paths,
error-handling paths are tested. Test cases should be design to uncover errors due to
erroneous computations, incorrect comparisons, or improper control flow. For this purpose
basis path and loop testing is done. After source level code has been developed, reviewed
and verified for correspondence to component level design, unit test case design begins. In
unit test application drivers are developed which are programs, accept test case data,
passes such data to the component to be tested and prints relevant results. Stubs are also
developed which serve to replace modules, that are subordinate the component to be tested.
Like all forms of software testing, unit tests can only show the presence of errors; it cannot show
the absence of errors.
Software testing is a combinatorial problem. For example, every Boolean decision statement
requires at least two tests: one with an outcome of "true" and one with an outcome of "false". As
a result, for every line of code written, programmers often need 3 to 5 lines of test code.
Therefore, it is unrealistic to test all possible input combinations for any non-trivial piece of
software without an automated characterization test generation tool such as JUnit Factory used
with Java code or many of the tools listed in List of unit testing frameworks.
To obtain the intended benefits from unit testing, a rigorous sense of discipline is needed
throughout the software development process. It is essential to keep careful records, not only of
the tests that have been performed, but also of all changes that have been made to the source
code of this or any other unit in the software. Use of a version control system is essential. If a
later version of the unit fails a particular test that it had previously passed, the version-control
software can provide a list of the source code changes (if any) that have been applied to the unit
since that time.
It is also essential to implement a sustainable process for ensuring that test case failures are
reviewed daily and addressed immediately. If such a process is not implemented and ingrained
into the team's workflow, the application will evolve out of sync with the unit test suite-
increasing false positives and reducing the effectiveness of the test suite.
Integration testing:-
Integration testing is systematic technique for constructing the program structure while at
the same time conducting the tests to uncover errors associated with interfacing. The
objective is to take unit tested components and build a program structure that has been
dictated by design. There are two types of integration Bottom up integration and Top
down integration. Regression and smoke testing are done in integration testing strategy.
Validation testing
Next step is the validation testing where requirements established as part of software
requirements analysis are validated against the software that has been constructed. At the
culmination of integration testing, software is completely assembled as a package,
interfacing errors has been uncovered and corrected, and a final series of software tests i.e.
validation testing begins. Validation succeeds when software functions in a manner that can
be reasonably expected by the customer.
Software validations can be achieved through a series of black-box tests that demonstrate
conformity with requirements. Configuration review, alpha testing and beta testing
techniques are conducted to enable the customer to validate all requirements. Acceptance
tests are conducted by the end-users over a period of weeks or months.
System testing
Finally, we arrive at system testing where the software and other system elements are tested as a
whole. System testing verifies that all elements mesh properly and that overall system function /
performance is achieved. Ultimately software is incorporated with other system elements and a
series of system integration and validation tests are conducted.
TEST NO. : 1
INPUT : PASSWORD
TEST CASE -2
TEST NO. :2
TEST NO. :3
RESULT : ACKNOWLEGMENT
T E S T C A S E -4
TEST NO. :4
RESULT : ACKNOWLEGMENT
TEST CASE -5
TEST NO. :5
RESULT : OK
TEST CASE 6
TEST NO :6
RESULT : OK