Software Engineering: Coding and Testing
Software Engineering: Coding and Testing
Software Engineering: Coding and Testing
Coding Standards-
• A coding standard gives a uniform appearance to the codes written by different engineers.
• It enhances code understanding.
• It encourages good programming practices.
Coding Standards And Guideline
Naming conventions for global variables, local variables, and constant identifiers
Do not use a coding style that is too clever or too difficult to understand
Normally, two types of reviews are carried out on the code of a module
Code Inspection:
The aim of code inspection is to discover some common types of errors caused due to oversight and
improper programming.
Software Documentation
Good documents are very useful and server the following purposes:
External documentation: These are the supporting documents that usually accompany a software
product
Program Testing
Testing a program consists of providing the program with a set of test inputs (or test cases) and observing if
the program behaves as expected.
Aim of testing
The aim of the testing process is to identify all defects existing in a software product.
Test case: This is the triplet [I,S,O], where I is the data input to the system, S is the state of the system at
which the data is input, and O is the expected output of the system.
Test suite: This is the set of all test cases with which a given software product is to be tested.
Functional testing vs. Structural testing
In the black-box testing approach, test cases are designed using only the functional specification
of the software, i.e. without any knowledge of the internal structure of the software. For this
reason, black-box testing is known as functional testing.
On the other hand, in the white-box testing approach, designing test cases requires thorough
knowledge about the internal structure of software, and therefore the white-box testing is called
structural testing..
BLACK-BOX TESTING
In the black-box testing, test cases are designed from an examination of the input/output values only and no
knowledge of design, or code is required.
The following are the two main approaches to designing black box test cases
Equivalence class portioning: In this approach, the domain of input values to a program is partitioned
into a set of equivalence classes
Boundary value analysis: Type of programming error frequently occurs at the boundaries of different
equivalence classes of inputs.
WHITE-BOX TESTING
A white box testing strategy can either be coverage-based of fault based.
Fault Based Testing: Target to detect certain types of faults. An example of a fault-based strategy is
mutation testing.
Coverage-based testing: this attemts to execute certain elements of a program. This typically targets to
execute certain program elements for discovering failers.