Composition and mocking - Deepstash
Introduction to Web 3.0

Learn more about technologyandthefuture with this collection

The differences between Web 2.0 and Web 3.0

The future of the internet

Understanding the potential of Web 3.0

Introduction to Web 3.0

Discover 36 similar ideas in

It takes just

6 mins to read

Composition and mocking

All software development is about the process of breaking a big problem down into smaller independent parts, combining the solutions to form an application that solves the big problem. 

Mocking is necessary when the decomposition strategy failed. When decomposition succeeds, a generic composition utility can be used to compose the pieces together.

3

0 reads

MORE IDEAS ON THIS

What is test coverage?

Code coverage is the amount of code covered by a test. Increasing coverage beyond 90% seems to have little continued correlation with lower bug density.

There are two kinds of coverage: 

  • Code coverage: how much of the code is exercised, and 
  • Case coverag...

3

0 reads

Tight coupling

Less coupling makes code easier to extend and maintain. Tight coupling makes code more rigid and brittle and more likely to break when changes are needed.

Coupling takes different forms: 

  • Subclass coupling is dependent on the implementation and hierarchy of the p...

3

0 reads

TDD should lead to better design

TDD should lead to better design

TDD should simplify code, not make it more complicated. If your code becomes harder to read or maintain when you make it testable, you're doing TDD wrong.

You can learn two things:

  • You can write decoupled code without dependency injection, and

3

1 read

What is a unit test?

Unit tests test individual units (modules, functions, classes) in isolation from the rest of the program.

  • Generally, units are tested using the public interface of the unit, known as black-box testing. It leads to less brittle tests.
  • In white box testing - whe...

3

0 reads

Causes of tight coupling

Tight coupling has many causes: 

  • Mutation vs immutability  
  • Side-Effects vs purity/isolated side-effects  
  • Responsibility overload vs Do One Thing (DOT)  
  • Procedural instructions vs describing s...

3

0 reads

Code smell

A code smell is a surface indication that points to a deeper problem in the system.

Different types of code need different levels (and different kinds) of mocks. Some code exists primarily to facilitate I/O, in which case, there is little to do other than test I/O. Reducing...

3

0 reads

CURATED FROM

CURATED BY

jopineda

Illustrator

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates