KEMBAR78
Coding - SDLC Model | PPTX
Software Engineering
Dr. Kamal Gulati
(Part 5) – Coding
Contents for Software Coding
1. Top-Down and Bottom –Up programming
2. structured programming
3. information hiding
4. programming style and
5. internal documentation
Problem Solving and Software
Engineering
• Coding without a solution design increases
debugging time.
• A team of programmers for a large software
development project involves
– An overall plan
– Organization
– Communication
• Software engineering
– Provides techniques to facilitate the development of
computer programs
What is Problem Solving?
• Problem solving
– The process of taking the statement of a problem
and developing a computer program that solves
that problem
• A solution consists of:
– Algorithms
• Algorithm: a step-by-step specification of a function to
solve a problem within a finite amount of time
– Ways to store data
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
• 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
Representative Coding Standards
Coding Standards And 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
Representative Coding Guideline
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.
What Is a Program?
• A problem-solving procedure
• A list of instructions
– Prewritten
– Custom-written
– Application software
– System software
What is Programming?
• Programming is software development
• Six step procedure
1. Program specification
2. Program design
3. Program code
4. Program test
5. Program documentation
6. Program maintenance
Step 1
Program Specifications
Input and Output Plans
Step 2
Program Design
• Plan a solution
• Use structured programming techniques
– Top-down program design
– Pseudocode
– Flowcharts
– Logic structures
Top-Down Program Design
Top-Down versus Bottom-Up
• A top-down design proceeds from an abstract, high-level
specification to a more and more detailed design by
decomposition and successive refinement
• A bottom-up design starts with detailed primitive blocks and
combines them into larger and more complex functional blocks
• Designs usually proceed from both directions simultaneously
– Top-down design answers: What are we building?
– Bottom-up design answers: How do we build it?
• Top-down controls complexity while bottom-up focuses on the
details
14-21
Pseudocode
• An outline of the logic for your program
• A summary of the program
Flowchart Symbols
Logic Structures
• Sequence structure
• Selection structure
• Loop structure
Step 3
Program Code
• Coding
• The good program
– Reliable
– Well documented
– Understandable to other
programmers
– Structured programs best method
Step 4
Program Test
• Debugging
– Testing
– Eliminating errors
• Syntax errors
• Logic errors
• Testing processing
14-26
Step 5
Documentation
• Written descriptions and procedures about a
program
• Important for people who will use the
program
– Users
– Operators
– Programmers
Step 6
Program Maintenance
• 75% of total lifetime cost
• Error-free operations
• Effective program
• Two categories
– Operations
– Changing needs
CASE Tools
• Computer-aided software engineering
• Automate development process
– Designing
– Coding
– Testing activities
Object-Oriented Software
Development
• Focuses less on procedures, more on
relationship between objects
• OOP: Object-oriented programming
• Object contains both the data and the
processing operations
Generations of Programming
Languages
• Occurring in “generations”
– Levels
– Machine languages to natural languages
• Lower level closer to machine language
• Higher level closer to human-like language
Generations of Languages
• 1st -- Machine languages
• 2nd -- Assembly languages
• 3rd -- High level procedural languages
• 4th -- Problem-Oriented Languages
• 5th -- Natural Languages & Visual programming
FAQs
• What is a program?
• What is a software engineer?
• What is the purpose of pseudocode?
• What are the qualities of a good program?
• What is the job of a maintenance
programmer? Why is it important?
• What are CASE tools?
• What is object-oriented programming?
Discussion Questions
• Discuss the six steps to create a program.
• Describe the differences between formatting
and programming languages. Give examples of
each.
• Explain the debugging process for a program.
• Why is program documentation important?
• Review the five generation levels of
programming languages.
ThankYou&
KeepLearning!
?Follow us :
You can find me at
https://www.linkedin.com/in/drkamalgulati/
https://mybigdataanalytics.in/
https://www.facebook.com/DrKamalGulatiBig
DATA/

Coding - SDLC Model

  • 1.
    Software Engineering Dr. KamalGulati (Part 5) – Coding
  • 2.
    Contents for SoftwareCoding 1. Top-Down and Bottom –Up programming 2. structured programming 3. information hiding 4. programming style and 5. internal documentation
  • 3.
    Problem Solving andSoftware Engineering • Coding without a solution design increases debugging time. • A team of programmers for a large software development project involves – An overall plan – Organization – Communication • Software engineering – Provides techniques to facilitate the development of computer programs
  • 4.
    What is ProblemSolving? • Problem solving – The process of taking the statement of a problem and developing a computer program that solves that problem • A solution consists of: – Algorithms • Algorithm: a step-by-step specification of a function to solve a problem within a finite amount of time – Ways to store data
  • 5.
    Coding The objective ofthe 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.
  • 6.
    Coding Standards AndGuideline • 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 Representative Coding Standards
  • 7.
    Coding Standards AndGuideline • 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 Representative Coding Guideline
  • 8.
    Code Review Code reviewfor 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.
  • 9.
    Software Documentation Good documentsare 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
  • 10.
    Program Testing Testing aprogram 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.
  • 11.
    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..
  • 12.
    Black-box testing In theblack-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.
  • 13.
    White-box testing A whitebox 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.
  • 14.
    What Is aProgram? • A problem-solving procedure • A list of instructions – Prewritten – Custom-written – Application software – System software
  • 15.
    What is Programming? •Programming is software development • Six step procedure 1. Program specification 2. Program design 3. Program code 4. Program test 5. Program documentation 6. Program maintenance
  • 16.
  • 17.
  • 18.
    Step 2 Program Design •Plan a solution • Use structured programming techniques – Top-down program design – Pseudocode – Flowcharts – Logic structures
  • 19.
  • 20.
    Top-Down versus Bottom-Up •A top-down design proceeds from an abstract, high-level specification to a more and more detailed design by decomposition and successive refinement • A bottom-up design starts with detailed primitive blocks and combines them into larger and more complex functional blocks • Designs usually proceed from both directions simultaneously – Top-down design answers: What are we building? – Bottom-up design answers: How do we build it? • Top-down controls complexity while bottom-up focuses on the details
  • 21.
    14-21 Pseudocode • An outlineof the logic for your program • A summary of the program
  • 22.
  • 23.
    Logic Structures • Sequencestructure • Selection structure • Loop structure
  • 24.
    Step 3 Program Code •Coding • The good program – Reliable – Well documented – Understandable to other programmers – Structured programs best method
  • 25.
    Step 4 Program Test •Debugging – Testing – Eliminating errors • Syntax errors • Logic errors • Testing processing
  • 26.
    14-26 Step 5 Documentation • Writtendescriptions and procedures about a program • Important for people who will use the program – Users – Operators – Programmers
  • 27.
    Step 6 Program Maintenance •75% of total lifetime cost • Error-free operations • Effective program • Two categories – Operations – Changing needs
  • 28.
    CASE Tools • Computer-aidedsoftware engineering • Automate development process – Designing – Coding – Testing activities
  • 29.
    Object-Oriented Software Development • Focusesless on procedures, more on relationship between objects • OOP: Object-oriented programming • Object contains both the data and the processing operations
  • 30.
    Generations of Programming Languages •Occurring in “generations” – Levels – Machine languages to natural languages • Lower level closer to machine language • Higher level closer to human-like language
  • 31.
    Generations of Languages •1st -- Machine languages • 2nd -- Assembly languages • 3rd -- High level procedural languages • 4th -- Problem-Oriented Languages • 5th -- Natural Languages & Visual programming
  • 32.
    FAQs • What isa program? • What is a software engineer? • What is the purpose of pseudocode? • What are the qualities of a good program? • What is the job of a maintenance programmer? Why is it important? • What are CASE tools? • What is object-oriented programming?
  • 33.
    Discussion Questions • Discussthe six steps to create a program. • Describe the differences between formatting and programming languages. Give examples of each. • Explain the debugging process for a program. • Why is program documentation important? • Review the five generation levels of programming languages.
  • 34.
    ThankYou& KeepLearning! ?Follow us : Youcan find me at https://www.linkedin.com/in/drkamalgulati/ https://mybigdataanalytics.in/ https://www.facebook.com/DrKamalGulatiBig DATA/