What is Unit Testing? Pros and cons of Unit Testing?
Published on: March 01, 2023
Last updated: May 26, 2023 Read in fullscreen view
Last updated: May 26, 2023 Read in fullscreen view
Recommended for you
- 02 Nov 2023 Differences between software walkthrough, review, and inspection
- 20 Mar 2022 What is a Multi-Model Database? Pros and Cons?
- 05 Jul 2020 What is Sustaining Software Engineering?
- 03 Jul 2022 What is the difference between Project Proposal and Software Requirements Specification (SRS) in software engineering?
- 15 Feb 2024 What is a Cut-Over in Software Development?
Unit testing is a type of atomic testing method that many people argue about. Some think it’s necessary and useful, while others don’t like to use it unless they are forced to do so, for example: Unit Testing is a part of a bidding project.
Theoretically, Unit Testing is a good for health software application, but why many people resists it, despite the fact that the software industry is becoming more complex and doom to failure without any measure against the rot code.
Pros of Unit Testing
- Change your mindset into "failing tests" first. Think about imperfection before you are going for perfection.
- Changes for developer team to dig through the implicit requirements.
- Changes for developer team to simplify the business complexity.
- Tests can fail intermittently for a number of reasons and identifying why they fail is often revealing about your codebase and environment.
Cons of Unit Testing
- Unit Testing (UT), literally half-automation testing, requires a more complex environment and lots of effort to set up and tear down. If test coverage is not sufficient enough, the test quality is not up to par. It's like a medical prescription which requires a sufficient amount of taking drugs to cure the disease.
- UT requires having go/no-go decision points, otherwise useless.
- UT is not a part of the project lifecycle. If UT is a must-have choice, it’s highly recommended to experimental UTs for a set of critical test cases, i.e. edge test cases. For the system upgrades in future, the technical team will extend test case scope for the intensive processing.
- UT brings the increased risks and increased cost for the project. it will take time to build the testing environment for Unit Testing.
- UT is useful for the commercial systems having a large user base or high volume of transaction data.
- UT cannot prevent the objective from the “unknown unknown risk” so in the run, it’s necessary to initiate the annual maintenance plan to prevent unplanned failure.
- It isn't realistic -- or necessary -- to expect 100% code coverage through UT. The unit tests a development team creates depends on business needs and the application or applications' complexity.
- If your team has no proper framework for UT execution, it's better to set up an isolated UT system to execute periodically not just development/staging but also production environment. This will not affect the performance of the up-and-running Portal system. There are various commerce tools to develop UT projects.
[{"displaySettingInfo":"[{\"isFullLayout\":false,\"layoutWidthRatio\":\"\",\"showBlogMetadata\":true,\"includeSuggestedAndRelatedBlogs\":true,\"enableLazyLoad\":true,\"quoteStyle\":\"1\",\"bigHeadingFontStyle\":\"1\",\"postPictureFrameStyle\":\"2\",\"isFaqLayout\":false,\"isIncludedCaption\":false,\"faqLayoutTheme\":\"1\",\"isSliderLayout\":false}]"},{"articleSourceInfo":"[{\"sourceName\":\"\",\"sourceValue\":\"\"}]"},{"privacyInfo":"[{\"isOutsideVietnam\":false}]"},{"tocInfo":"[{\"isEnabledTOC\":true,\"isAutoNumbering\":false,\"isShowKeyHeadingWithIcon\":false}]"}]
Via
{content}