Launchpad
Launchpad
Launchpad
  • Introduction
  • General
    • Installation
    • Creating a subscriber
    • Contributing
  • Tutorials
    • Beginner documentation
      • Beginner handbook
        • Creating subscribers
        • Wiring subscribers
        • Installing local environment
        • Adding front-end
        • Building the plugin
      • Plugin life circle
        • Activation
        • Deactivation
        • Uninstall
    • Starting with the framework
    • Migrating to Launchpad
    • Notions
      • Framework concepts
        • Inversion of control
        • Subscribers
        • Dispatcher
      • Good practices
        • Hooks
          • Preventing magic constants
          • Decouple features
          • Sanitize filters output
      • Testing
        • Organize tests
  • CLI
    • Commands
    • Creating a command
  • Testing
    • Unit test
    • Fixtures
    • Integration test
  • Container
    • Architecture
    • Parameters
    • Providers
    • Auto wiring
    • Manual wiring
    • Activation/Deactivation
    • Inflectors
  • Modules
    • Definition
    • Listing
      • Action Scheduler
      • BerlinDB
      • Bus
      • Options
      • Renderer
      • Logger
      • Uninstaller
      • Filesystem
      • Front-end
      • Hook extractor
    • Creating a module
Powered by GitBook
On this page
  1. Tutorials
  2. Notions

Testing

PreviousSanitize filters outputNextOrganize tests

Last updated 11 months ago

When talking about testing the first step is always to understand how the process works to actually understand what are the possibilities and constraints.

Testing is actually just comparing your code results to the expectations you have for that code.

Due to that tests are able to verify that a bug is not present inside your code but not that your code is except of bugs.

Please mind the difference between theses are it has its importance.

In the same fashion I also love to hate the sentence "Have you tested your code?".

The reason is not that I am lazy to write tests but rather than I think this expression is the perfect illustration for the hell is paved with good intentions.

When saying that to a junior developer no harm is meant. However, it is leading them in the wrong direction as basing expectations of tests on the code will generate blind tests.

When testing it is important to base them instead on the project expectations with tools like acceptance criteria and write tests before the code, so we can make sure we don't fall into that tempting trap.