What is a Bug?
In the Software development life cycle, the project team gathers customers’ requirements, analyzes them, designs the UI, and develops and tests the required software.
The SDLC model decides when testing is to be carried out on the developed software. For example, in the Waterfall model, testing is done after the complete development of the software, whereas in the V-model continuous testing is carried out at each stage of SDLC, and when it comes to Agile, testing is done for all the users stories. No matter which SDLC model is used, testing is a must, and whenever a tester observes an unexpected behavior of the software in testing, they will report it as a bug.
A bug alters the behavior of the software and the software does not function as expected. Bugs can be functional, behavioral, or cosmetic. Any deviation from the user story, any glitch in the UI, or if the software does not function as intended by the developer then it is termed a bug.
A bug can cause malfunction. A bug could occur due to multiple reasons like coding errors, inadequate understanding of the requirement, miscommunication between teams, misunderstanding the requirements and designs, the complexity of code, design, architecture, and changes in the environment, etc. They are generally found during the testing phase. For example, assume you have asked the user to select three options in a form, but instead of a checkbox, there is a radio button.
Examples of different bugs
Functional bug: the user cannot log in to a website, or the search option is not working, and a high-priority bug is the application crashes or hangs
Cosmetic bugs: Screen alignments, section divisions, string truncations, translation issues, the color of the texts, etc.
Performance bugs: When the application takes a long time to load a screen, and the screen navigation in the application is very slow, etc.
Compatibility bugs: When software behavior is inconsistent among different operating systems and multiple browsers.
What is a Defect?
A defect is also the unexpected behavior of the software but observed after releasing the software to the user means in production. If the feature does not work as per the user’s requirements, then it is termed a defect. A defect affects the usability and experience of the software.
Defects can occur due to poor design, requirement mismatch, incorrect data, or unexpected errors. Defects are hard to fix when compared to bugs. The cost of fixing a defect is also higher. Sometimes, it becomes difficult to fix the defect due to the massive code change that it comes with; in such cases, the users might have to use the software with the defect and find a workaround to solve the problem. For example, the user cannot add more than three products to the cart.
Example of Defects
Design defects: Assume the logo of a company is improperly displayed on the home screen of any application. It is a major issue that needs to be fixed immediately as it will impact the company’s reputation.
Logical defects: Code errors and issues due to incorrect logic in code, these types of defects can occur due to misunderstanding of the requirement. Assume there is a file upload option on the website if it fails to upload after a certain file size. (Assume the file size limit is 100 MB, but the software is failing to upload a 10 MB file).
Integration Defects: When multiple modules exist in any software development, modules should interact with each other in such cases; integration testing will be carried out if any issues are missed out, capture at this stage may lead to a defect in production. ( Assume a mail trigger option fails to send mail to respective users).
Performance Defects: The performance of any software is down in certain conditions. Assuming there is a delay in alerting the user of unauthorized access to his account, there will be a huge loss.