Ken Hamric

102 posts

Ken Hamric banner
Ken Hamric

Ken Hamric

@ken_hamric

Katılım Aralık 2021
76 Takip Edilen8 Takipçiler
Ken Hamric retweetledi
TestMu AI
TestMu AI@testmuai·
🕵️Uncover the role of trace-based testing in the testing pyramid! @ken_hamric explores this innovative approach. (10/16) bit.ly/3oXaFkz
English
1
1
1
81
Dr Milan Milanović
Dr Milan Milanović@milan_milanovic·
𝗧𝗵𝗲 𝗧𝗲𝘀𝘁𝗶𝗻𝗴 𝗣𝘆𝗿𝗮𝗺𝗶𝗱 We all want that our software doesn't have any known or unknown defects. Some of those defects can be reduced when we have a built-in quality in our software development process. One of the most important parts of a high-quality process is tests. They allow us to go faster and safer during our development process, but also provide us with critical feedback when we do something wrong. Mike Cohn published a book in 2010. called "𝗦𝘂𝗰𝗰𝗲𝗲𝗱𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗔𝗴𝗶𝗹𝗲", in which he presented the concept of "The Test Pyramid". It is a concept that helps developers and testers rank different types of tests to create a balanced, efficient, and effective testing strategy. 𝗧𝗵𝗲 𝗽𝘆𝗿𝗮𝗺𝗶𝗱 𝗶𝗹𝗹𝘂𝘀𝘁𝗿𝗮𝘁𝗲𝘀 𝘁𝗵𝗲 𝗶𝗱𝗲𝗮𝗹 𝗱𝗶𝘀𝘁𝗿𝗶𝗯𝘂𝘁𝗶𝗼𝗻 𝗼𝗳 𝘁𝗲𝘀𝘁 𝘁𝘆𝗽𝗲𝘀, with the base representing the largest number of tests and the top representing the smallest number. The Testing Pyramid has 𝘁𝗵𝗿𝗲𝗲 𝗺𝗮𝗶𝗻 𝗹𝗲𝘃𝗲𝗹𝘀: 𝟭. 𝗨𝗻𝗶𝘁 𝘁𝗲𝘀𝘁𝘀 (bottom level): These tests focus on individual components or functions of the software. They are small, quick to execute, and usually written by the developers themselves. Unit tests should make up the largest part of the test suite, as they are the most granular and help catch issues early in the development process. 𝟮. 𝗜𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻 𝘁𝗲𝘀𝘁𝘀 (middle level): These tests check the interaction between many components or subsystems within the software. Integration tests are more complex than unit tests, as they confirm that different parts of the system work together . They take longer to execute and must more effort to maintain but are essential for ensuring that the system functions as a whole. 𝟯. 𝗘𝗻𝗱-𝘁𝗼-𝗲𝗻𝗱 (𝗘𝟮𝗘) 𝘁𝗲𝘀𝘁𝘀 or System tests (top-level): These tests confirm the entire system, including the user interface, APIs, and any external dependencies. E2E tests simulate real-world user scenarios and ensure that the system behaves as expected from the user's perspective. These tests are the most complex, time-consuming, and expensive to maintain, so they should be used sparingly. There are also other different 𝘃𝗮𝗿𝗶𝗮𝘁𝗶𝗼𝗻𝘀 of this pyramid: 🔹 𝗜𝗰𝗲 𝗰𝗿𝗲𝗮𝗺 𝗰𝗼𝗻𝗲 𝗺𝗼𝗱𝗲𝗹: This anti-pattern inverts the testing pyramid, with a large number of E2E tests, fewer integration tests, and even fewer unit tests. This approach is problematic because it leads to slow and brittle test suites that are difficult to maintain. 🔹 𝗗𝗶𝗮𝗺𝗼𝗻𝗱 𝗺𝗼𝗱𝗲𝗹: This model adds an extra layer for component or contract tests between the integration and E2E tests. These tests focus on validating the contracts or interfaces between external services and the application, ensuring that they adhere to the agreed-upon specifications. 🔹 𝗛𝗼𝗻𝗲𝘆𝗰𝗼𝗺𝗯: This model focuses on risk-based testing, where the number of tests in each layer depends on the risk profile of the application. For example, a safety-critical system might require more extensive E2E testing, while a simple web application may rely more on unit and integration tests. About 𝗰𝗼𝗱𝗲 𝗰𝗼𝘃𝗲𝗿𝗮𝗴𝗲, our goal shouldn't be 100% test coverage, because that metric doesn't say much about the quality of our tests. We need to aim for 𝟲𝟬-𝟴𝟬%, where all major use cases and known edge cases are covered, as well as external systems, such as DBs, file systems, APIs, etc. One important thing to mention is that we need to have all these tests 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗲𝗱 𝗶𝗻 𝗮 𝗖𝗜/𝗖𝗗 𝗽𝗶𝗽𝗲𝗹𝗶𝗻𝗲. This means that when creating a PR, a build pipeline with running tests will be done and it will represent a quality gate before merging any new code in the repo. _______ If you like my posts please follow me @milan_milanovic and hit the 🔔 on my profile to get a notification for all my new posts. Grow with me 🚀! #technology #softwareengineering #programming #techworldwithmilan #testing
Dr Milan Milanović tweet media
English
3
5
24
4K