Coding and Testing
Coding and Testing
QUE 1 :CODING
The coding is the process of transforming the design of a system into a computer
language format.
This coding phase of software development is concerned with software translating
design specification into the source code.
It is necessary to write source code & internal documentation so that the code to its
specification can be easily verified.
Coding is done by the coder or programmers who are independent people than the
designer.
The goal is not to reduce the effort and cost of the coding phase, but to cut to the cost
of a later stage.
The cost of testing and maintenance can be significantly reduced with efficient coding.
Goals of Coding
1. To translate the design of system into a computer language format: The coding is the
process of transforming the design of a system into a computer language format, which can
be executed by a computer and that perform tasks.
2. To reduce the cost of later phases: The cost of testing and maintenance can be significantly
reduced with efficient coding.
3. Making the program more readable: Program should be easy to read and understand. It
increases code understanding having readability and understandability as a clear objective of
the coding.
Characteristics of Programming Language
Purpose of Documentation:
If there’s a lot of content, you can organize it in the glossary part at the end of
the document.
List down synonyms, antonyms and difficult terminologies used.
2. Avoid unnecessary repetition: The back-end database stores
every piece of information as an individual unit and displays it in various different variety
of context so redundancy at any point will not be maintainable and is considered a bad
practice.
3. Avoid ambiguity:
Documentation contains a lot of information regarding the versatile functionalities of the software
system, every part of it must be written with clear and precise knowledge while avoiding any
conflicting information that might cause confusion to the reader.
In order to maintain the professionalism, accuracy, and precision of the document a certain set of
principles must be followed taking reference from other software documentations.
5. Record a Rationale
This principle applies to the maintainers of the documentation of the software, because updates are
made to the software on frequent intervals.
7. Review documentation
The documentation consists of too many web-pages collectively holding a large chunk of information
that’s serving a sole purpose – educate and spread knowledge to anyone who is trying to understand
or implement the software.
The presence of documentation helps in keeping the track of all aspects of an application
and also improves the quality of the software product.
The main focus is based on the development, maintenance, and knowledge transfer to other
developers.
The software development process often takes place under time pressure, due to which
many times the documentation updates don’t match the updated code.
The documentation has no influence on the performance of an application.
QUE:4 TESTING
Black-box testing is a type of software testing in which the tester is not concerned
with the software’s internal knowledge or implementation details but rather
focuses on validating the functionality based on the
provided specifications or requirements.
Functional Testing
Functional testing is defined as a type of testing that verifies that each function of the
software application works in conformance with the requirement and specification.
This testing is not concerned with the source code of the application. Each functionality of
the software application is tested by providing appropriate test input, expecting the output,
and comparing the actual output with the expected output.
Regression Testing
Regression Testing is the process of testing the modified parts of the code and the parts that
might get affected due to the modifications to ensure that no new errors have been
introduced in the software after the modifications have been made.
Regression means the return of something and in the software field, it refers to the return of
a bug. It ensures that the newly added code is compatible with the existing code.
Nonfunctional Testing
Non-functional testing is a software testing technique that checks the non-functional
attributes of the system.
It is defined as a type of software testing to check non-functional aspects of a software
application.
It is designed to test the readiness of a system as per nonfunctional parameters which are
never addressed by functional testing.
Advantages of Black Box Testing
The tester does not need to have more functional knowledge or programming skills to
implement the Black Box Testing.
It is efficient for implementing the tests in the larger system.
Tests are executed from the user’s or client’s point of view.
Disadvantages of Black Box Testing
There is a possibility of repeating the same tests while implementing the testing process.
Without clear functional specifications, test cases are difficult to implement.
It is difficult to execute the test cases because of complex inputs at different stages of testing.
Sometimes, the reason for the test failure cannot be detected.
QUE 6:WHITE BOX TESTING
To exercise the statements in the above white box testing example, WhiteBox test
cases would be
A = 1, B = 1
A = -1, B = -3
QUE 7:DEBUGGING
Process of Debugging
Step 1: Reproduce the Bug
To start, you need to recreate the conditions that caused the bug. This means making the
error happen again so you can see it firsthand.
Seeing the bug in action helps you understand the problem better and gather important
details for fixing it.
Step 2: Locate the Bug
Next, find where the bug is in your code. This involves looking closely at your code and
checking any error messages or logs.
Developers often use debugging tools to help with this step.
Step 3: Identify the Root Cause
Now, figure out why the bug happened. Examine the logic and flow of your code and see
how different parts interact under the conditions that caused the bug.
This helps you understand what went wrong.
Step 4: Fix the Bug
Once you know the cause, fix the code. This involves making changes and then testing the
program to ensure the bug is gone.
Sometimes, you might need to try several times, as initial fixes might not work or could
create new issues.
Using a version control system helps track changes and undo any that don’t solve the
problem.
Step 5: Test the Fix
After fixing the bug, run tests to ensure everything works correctly. These tests
include:
Unit Tests: Check the specific part of the code that was changed.
Integration Tests: Verify the entire module where the bug was found.
System Tests: Test the whole system to ensure overall functionality.
Regression Tests: Make sure the fix didn’t cause any new problems elsewhere in the
application.
Step 6: Document the Process
Finally, record what you did. Write down what caused the bug, how you fixed it, and any
other important details.
This documentation is helpful if similar issues occur in the future.
Debugging Approaches/Strategies
1. Brute Force: Study the system for a longer duration to understand the system.
2. Backtracking: Backward analysis of the problem which involves tracing the program
backward from the location.
3. Forward analysis of the program involves tracing the program forwards using breakpoints or
print statements.
4. Using A debugging experience with the software debug the software with similar problems
in nature.
5. Cause elimination: it introduces the concept of binary partitioning.
1.Finding faults and Security Vulnerabilities in the Code: Automatic programme analysis tools
can find and highlight possible faults, security flaws and bugs in the code. Memory Leak
2.Detection: Certain tools are designed specifically to find memory leaks and inefficiencies. By
doing so, developers may make sure that their software doesn’t gradually use up too much
memory.
Static Program Analysis Tool is such a program analysis tool that evaluates and computes various
characteristics of a software product without executing it. Normally, static program analysis tools
analyze some structural representation of a program to reach a certain analytical conclusion.
Whether the coding standards have been fulfilled or not.
It is the simplest integration testing approach, where all the modules are
combined and the functionality is verified after the completion of individual
module testing.
In simple words, all the modules of the system are simply put together and
tested.
This approach is practicable only for very small systems. If an error is found
during the integration testing, it is very difficult to localize the error as the error
may potentially belong to any of the modules being integrated.
So, debugging errors reported during Big Bang integration testing is very
expensive to fix.
There will be quite a lot of delay because you would have to wait for all the
modules to be integrated.
High-risk critical modules are not isolated and tested on priority since all
modules are tested at once.
High risk of integration problems that are difficult to identify and diagnose.
In this testing, the complexity that occurs when the system is made up of a
large number of small subsystems.
Mixed approach is useful for very large projects having several sub projects.
For mixed integration testing, it requires very high cost because one part has a
Top-down approach while another part has a bottom-up approach.
2.Create a test plan: Develop a test plan that outlines the scenarios and test
cases that need to be executed to validate the integration points between the
different components. Set up test 3.environment: Set up a test environment that
mirrors the production environment as closely as possible.
4. Execute the tests: Execute the tests outlined in your test plan, starting with
the most critical and complex scenarios.
6. Analyze the results: Analyze the results of your integration tests to identify
any defects or issues that need to be addressed.
7. Repeat testing: Once defects have been fixed, repeat the integration testing
process to ensure that the changes have been successful and that the
application still works as expected.
Class-to-class dependencies
Generally, software quality management is of three types: Quality Assurance, Quality Planning,
and Quality Control.
Quality Planning:
o How accessible is your product to different users?
o How about the modularity aspects- can your developers reuse the code to
perform the same action at various locations?
o How robust is your website when multiple customers log in?
o Answering such questions is where quality management and planning come into
the picture.
o You address different aspects such as the market you intend your product to
outperform, the release date of new updates, addressing potential risks,
possessing quality goals, and developing the needed risk management policy.
Quality Control:
process.