Audience
This applies to software developers at all levels interested in good Software Architecture. I use Java code snippets for demonstration. PowerMock may be specific to the JVM ecosystem, but there may be analogous tools in other eco systems. Ports & Adapters is a language-agnostic architectural pattern.
Takeaways
- Not a Test-Pyramid talk!
- Learn how the need to use Invasive tools like PowerMock literally mock at the OO principles like Encapsulation, through hands-on demonstration.
- What are some of the Anti-pattern traps that force devs to depend on PowerMock and how to avoid them.
- Let's discuss Ports & Adapters architecture and understand how it eases Testing the Domain logic, without the need to bend the byte-code with invasive tools like PowerMock.
Links
Loki won the hackathon in Salesforce and many teams are using it successfully to prevent PowerMock and write quality unit-tests.
- Hackathon pitch video: https://youtu.be/daiNyNDdj7g
(The video may have few salesforce specific content but the talk won't have those and it is generic to all).
Objective of the presentation:
PowerMock is often used to bend the Object-(Dis)Orientation for inflated code-coverage numbers, but it incubates the actual design ailment, which grows as your codebase grows. **Ports & Adapters aka Clean Architecture** is the *right* way to treat it. Let's discuss this architectural pattern and how:
- It let’s you unit test domain logic in isolation, which organically boosts test coverage
- It’s transparent and declarative, so the tests written using this pattern are easy to maintain
- It acts as a framework to enforce appropriate DI and promote clean OO
Attendee pre-requisites - If none, enter "N/A":
N/A