Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Follow publication

Code Smell 54 — Anchor Boats

Maximiliano Contieri
Dev Genius
Published in
2 min readJan 6, 2021

Photo by Kris Mikael Krister on Unsplash

Problems

  • Complexity
  • Coupling

Solutions

  1. Remove dead code.
  2. Leave covered and real tested code.

Sample Code

Wrong

Right

Detection

Using some mutation testing variants we can remove the dead code and see it test fails.

We need to have good coverage to rely on this solution.

Tags

  • YAGNI

Conclusion

Dead code is always a problem.

We can use modern development techniques like TDD to ensure all code is alive.

Relations

More info

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Written by Maximiliano Contieri

I’m a senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan. Maximilianocontieri.com

No responses yet

Write a response