Back to Basics Testing
Back To Basics PHIL NASH Testing 1What is a test? 8operation test? What is a 9operation input values + test? What is a 10What is a operation input values + expected output values test Mutation Negative Non-functional Operational Orthogonal array Pair Parallel Passive Path Penetration Performance Qualification Ramp Recovery Regression Requirements Sanity Scalability Scenario Unit Tests Tests TestsWhat is a test? 18 Integration System Unit Tests Tests Tests The testing pyramidWhat is a Test? 19 UnitWhat is a Test? 20 Unit Michael Feathers A test is not a0 码力 | 79 页 | 25.86 MB | 5 月前3Scientific Unit Testing
Scientific Unit Testing Dave Steffen, Ph.D. Software Lead in Physics which is relevant dsteffen@scitec.com www.scitec.com 1If I have seen further than others, it is by standing upon the shoulders Deterministic Code coverage / regulatory requirement ... 3Unit Testing OO Code Test using only the public interface ("Black Box" testing) Forces better design ("design for testability") Avoids tight coupling to implementation Unit tests are also examples and documentation 4Object Oriented testing Let's unit test this class // Cup.h class Cup { public: Cup(); // creates0 码力 | 45 页 | 1.91 MB | 5 月前3Testing Compile-time Constructs Within a Runtime Unit Testing Framework
© 2021 Apex.AI, Inc. Igor Bogoslavskyi Testing the compilability of the code at runtime© 2021 Apex.AI, Inc. Errors have a high cost, so rigorous testing is a must We use increasingly more compile-time t_v>> T get_half_of(T smth) { return smth / T{2}; }© 2021 Apex.AI, Inc. Write a rigorous testing suite #include TEST(TestMyApi, Halving) { EXPECT_FLOAT_EQ(21.0F, get_half_of(42 Standard testing pipeline image: Flaticon.com test_halving.cpp image: Flaticon.com Compiler image: Flaticon.com Test binary GoogleTest ✅ flags© 2021 Apex.AI, Inc. Proposed testing pipeline 0 码力 | 50 页 | 1.37 MB | 5 月前3Back to Basics Unit Testing
1Unit Testing is a Big Topic 2Unit Testing is a Big Topic Jody Hagins (today): The Most Important Design Guideline is Testability Greg Law and Mike Shah (tomorrow): Back To Basics, Debugging and Testing (Thursday): Mix Assertion, Logging, Unit Testing and Fuzzing Pete Muldoon (Wednesday) Dependency Injection in C++ "Accelerated TDD" by Phil Nash just finished "C++ Testing like a Ninja for Novice Testers" 3Learning Unit Testing CppCon 2015: T. Winters & H. Wright “All Your Tests are Terrible..." 4Rule 0 Write unit tests 5Part 0: Basics of the Basics Unit testing is the act of testing the correctness0 码力 | 109 页 | 4.13 MB | 5 月前3Back To Basics Debugging and Testing
Testing and DebuggingWriting software is really hard. If it’s not tested, it doesn’t work. Or at least it will soon stop working.WHAT’S WRONG WITH THIS PICTURE Write the code Add tests Debug DeployTest-Driven DeployTest-Driven Development Write tests “Debug” the tests DeploySoftware development is basically testing and debugging. done rightGOOD TESTS ARE… ● Independent ● Repeatable ● FastDIFFERENT TESTS – generally shallow / easy-to-fix. Tests run fast – tight feedback loop. But… Assumptions!UNIT TESTING FRAMEWORKS ● Google Gest ● Catch2 ● Boost.Test ● CppUTest ● doctestGOOGLE TEST (GTest) // Tests0 码力 | 50 页 | 2.04 MB | 5 月前3Noexcept: Enabling Testing of Contract Checks
Noexcept? Enabling Testing of Contract Checks Pablo Halpern and Timur Doumler This work by Pablo Halpern & Timur Doumler is licensed under a Creative Commons Attribution 4.0 International License time • How to unit test contract-checking annotations (CCAs) • How noexcept interacts with unit testing of CCAs. We will go over everything twice! 4-Oct-23 Pablo Halpern and Timur Doumler, 2023 (CC BY 15Unit Testing, CCAs and Exception Specifications • CCAs can themselves the a source of bugs and should verified as part of unit testing. • Overuse of noexcept can interfere with such unit testing • We've0 码力 | 90 页 | 1.38 MB | 5 月前3Continuous Regression Testing for Safer and Faster Refactoring
1 Aurora InnovationContinuous Regression Testing for Safer and Faster Refactoring Pejman Ghorbanzade Aurora Innovation3 Aurora Innovation Engineers spend 17 hours per week maintaining software. *Stripe continuous regression testing How does regression testing work in practice How to build a regression testing system Going beyond �nding behavioral regressions How to use regression testing effectively Establishing all possible behaviors of your system will occur.” - Hyrum's law (modi�ed)14 Aurora Innovation Testing as risk mitigation If every code change can break our software, how could we stay productive and0 码力 | 85 页 | 11.66 MB | 5 月前3Mix Assertion, Logging, Unit Testing and Fuzzing with ZeroErr
Mix Assertion, Logging, Unit Testing and Fuzzing with ZeroErr Build Safer Modern C++ Application Speaker: Xiaofan Sun Date: Sep 19, 2024Self-Introduction • Got my Ph.D. from UC, Riverside Riverside last year • Automatic testing of multithreading programs • Symbolic execution improvements • Fault detection in concurrent data structures • Now working in NVIDIA HWInf Team • Job: Infrastructure zeroerr::format(__VA_ARGS__)Printing in both Logging & Assertion Smart assertion in user code / unit testing also need pretty printing, e.g.: ASSERT(a != 0, "a should not be 0. Input is: {}", input); LOG("Input0 码力 | 54 页 | 961.46 KB | 5 月前3MACRO-FREE TESTING WITH C++20
CPPCON 2020 / CPPCON 2020 / MACRO-FREE TESTING MACRO-FREE TESTING WITH C++20 WITH C++20 | | | | HTTPS://BOOST-EXT.GITHUB.IO/UT/CPPCON-2020 HTTPS://BOOST-EXT.GITHUB.IO/UT/CPPCON-2020 KRIS@JUSIAK0 码力 | 53 页 | 1.98 MB | 5 月前3Quickly Testing Qt Desktop Applications With Approval Tests
1 Quickly Testing Qt Desktop Applications with Approval Tests Clare Macrae (She/her) clare@claremacrae.co.uk 16 September 2020 CppCon (Online)2 Audience: Developers testing Desktop GUIs, including –Setting Up Testing –Error-prone Things –Approval Tests •Extras –Tools –Summary4 About Me • Scientific C++ and Qt developer since 1999 • My mission: Sustainable and efficient testing and refactoring designed for testing Needs refactoring to add tests Can’t refactor without tests7 Typical Scenario • • • • • Need to change the code No tests Not designed for testing Needs refactoring0 码力 | 77 页 | 6.96 MB | 5 月前3
共 228 条
- 1
- 2
- 3
- 4
- 5
- 6
- 23