• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Vietnam Colors

Update Latest Travel News from Vietnam and All Around The World

  • About Us
  • Contact Us
  • Disclaimers
  • DMCA
  • Privacy Policy
  • Submit your story
You are here: Home / Should I write tests for legacy code if there’s no time for refactoring?

Should I write tests for legacy code if there’s no time for refactoring?

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange , a free, community-powered network of 100+ Q&A sites . is4 asks: I usually try to follow the advice of the book Working Effectively with Legacy Code . I break dependencies, move parts of the code to @VisibleForTesting public static methods and to new classes to make the code (or at least some part of it) testable. And I write tests to make sure that I don’t break anything when I’m modifying or adding new functions. A colleague says that I shouldn’t do this. His reasoning: The original code might not work properly in the first place. And writing tests for it makes future fixes and modifications harder since devs have to understand and modify the tests too. If it’s GUI code with some logic (~12 lines, 2-3 if/else blocks, for example), a test isn’t worth the trouble since the code is too trivial to begin with. Similar bad patterns could exist in other parts of the codebase, too (which I haven’t seen yet, I’m rather new); it will be easier to clean them all up in… Read full this story

  • Could You Pass the U.S. Citizenship Test?
  • Now here's the good news: Pioneering drugs that almost double bowel cancer survival time are among the medical breakthroughs overlooked in a year of Covid gloom
  • Diego Maradona, one of the greatest footballers of all time, dies aged 60
  • India vs Australia: BCCI formally writes to CA on relaxation of Brisbane hard quarantine
  • I caught Covid from a hospital, we must give all NHS workers the jab – now, writes ex-Government adviser VIVIENNE PARRY
  • My chest pains are terrifying – so why are tests all clear? DR ELLIE CANNON answers your questions
  • Give adequate time for a probe
  • Groundbreaking finger-prick cancer test is TEN TIMES more sensitive than current methods and could identify patients that are likely to relapse
  • Britain breaches 1,000 daily Covid deaths for first time since APRIL and health chiefs post ANOTHER record-high 62,322 cases as Boris Johnson quietly extends draconian new COVID laws until the end of MARCH
  • UK Test and Trace System Reportedly to be Outsourced to Logistics Giant Like Amazon to Meet Demand
Should I write tests for legacy code if there’s no time for refactoring? have 376 words, post on arstechnica.com at June 7, 2014. This is cached page on Vietnam Colors. If you want remove this page, please contact us.

Primary Sidebar

RSS Recent Stories

  • Gurbaz, Najibullah and bowlers help Afghanistan stay alive in the series
  • Wyatt stars as Brave begin campaign with record chase
  • Pujara’s 79-ball 107 in vain as Warwickshire clinch thriller
  • Injured Washington Sundar doubtful for Zimbabwe tour
  • 20 Questions On Deadline Podcast: Sydney Sweeney Wants ‘Euphoria’ Season 3 To Continue Cassie’s “Craziness”, Is “Loving It” On ‘Madame Web’

Sponsored Links

  • How American stocks could continue to climb
  • Which is The Economist’s country of the year for 2021?
  • After a shocker in 2021, where might inflation go in 2022?
  • The hidden costs of cutting Russia off from SWIFT
  • Has the pandemic shown inflation to be a fiscal phenomenon?
Copyright © 2022 Vietnam Colors. Power by Wordpress.
Home - About Us - Contact Us - Disclaimers - DMCA - Privacy Policy - Submit your story