0% found this document useful (0 votes)
475 views10 pages

Software Engineering: Coding and Testing

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 10

Software Engineering

Coding And Testing


Coding
The objective of the coding phase is to transform the design of a system into code in a high-level
language and then to unit test this code.
Good software development organizations normally require their programmers to adhere to some well-defined and
standard style of coding called coding standards.

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

Representative Coding Standards

 Limiting the use of global data type

 Contents of the headers preceding codes for different modules

 Naming conventions for global variables, local variables, and constant identifiers

 Error return conventions and exception handling mechanisms


Coding Standards And Guideline

Representative Coding Guideline

 Do not use a coding style that is too clever or too difficult to understand

 Avoid obscure side effects

 Do not use an identifier for multiple purposes

 The code should be well-documented

 The length of any function should not exceed 10 source lines

 Do not use goto statements


Code Review
Code review for a model is carried out after the module is successfully compiled and the all the
syntax errors have been eliminated

Normally, two types of reviews are carried out on the code of a module

 Code Walk Through:

To discover the algorithm and logical errors in the code.

 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:

 Good documents enhance understandability and maintainability of a software product.

 Helps the users in effectively using the system.

 Helps in effectively handling the manpower turnover problem

 Helps the manager in effectively tracking the progress of the project

Software Documentation classified into the following:


 Internal documentation: These are provided in the source code itself

 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.

Some commonly used terms associated with testing are:

 Failure: This is a manifestation of an error (or defect or bug).

 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.

You might also like