Skip to main content

Sudoku refactoring

 

Sudoku Refactoring Kata

Following Jay and Llewellyn on their sudoku refactoring, I have forked the sudoku repo and added the java version. As usual, I will post the snippets I found useful in doing the refactoring

Snippets

  • Golden Master
  • Extract Method
  • Extract anonymous class to named class
  • Delete Comments
  • convert parameters to object
  • move the inner class to upper level
  • specify type explicitly
  • transform out parameters to object
  • move types to matching files
  • inline variable
  • extract variable
  • move line above
  • move method to a different class
  • replace static with non-static
  • split variable declaration assignment
  • move method to the constructor
  • isolate field assignment
  • remove unused directives
  • extract constant
  • extract class from a field
  • return value early
  • remove redundant else
  • surround with block
  • asas
  • asas

References

Jay and Llewellyn Series on Sudoku Refactoring

https://www.youtube.com/watch?v=BVGH-dNn-tc&ab_channel=LlewellynFalco
https://www.youtube.com/watch?v=8dyZHMuCiKc&ab_channel=LlewellynFalco
https://www.youtube.com/watch?v=WvSr6E-cO9M&ab_channel=LlewellynFalco
https://www.youtube.com/watch?v=GU_8eMJ8Xd0&ab_channel=LlewellynFalco
https://www.youtube.com/watch?v=f2mZ7v9O3c8&ab_channel=LlewellynFalco
https://www.youtube.com/watch?v=SUgp-msVqnA&ab_channel=LlewellynFalco

Comments

Popular posts from this blog

Yet another interpretation of pyramid tests

In recent conversations regarding automating tests, It seems to me that the common understanding of the team is that the only acceptable automated test case is through the workflow tests through the UI. As far as I know, that’s not entirely correct and per “Pyramids of Automation” chapter 15 in More Agile Testing , I think there are lots of different ways we can automate test cases. I would like to take the opportunity to describe the pyramids of automation again with some thoughts/questions. First, let me try to describe the original pyramid again, and here’s the picture that is worth thousands of words Per the above pyramid from Mike Cohn with some modification in “More Agile Testing”, the lowest level, the unit tests, gets the fastest feedback on every commit which would provide the most benefits. The higher the tests located in the pyramid texts, the slower the feedback and lower profit we would get from the automated tests . “The test automation pyramid is a model intended to guid...

Collaborative Learning at Coderetreats

Written collaboratively by: Trung Vo, Bob Allen, Jacqueline Bilston, Christopher Fietz, Llewellyn Falco “… I really liked that there was something there for every level and anytime I would get stuck, there was someone there to help….” — Sara K. What is a Coderetreat? Coderetreat is a day dedicated to allowing developers time to practice their craft. The focus is on practicing skills like Test-Driven Development (TDD), refactoring, and incremental design that is proven to make developers move faster with fewer bugs. It is designed to enable participants to focus on their practice, with as few distractions as possible. The day is made up of several short sessions where we either work in pairs or mobs to solve a small coding problem. Each session, we start new with the same problem; this allows us to focus on the new skill we are learning. What do you get out of it? Coderetreat is an excellent place to learn what you know and what you don’t know. As in life in general, there are always ne...

4 hours body summary

The lowest effective dosage the smallest dose that will deliver your intended result to eliminate stored fat , perform a bare minimum to activate a fat-loss cascade of particular hormones to build muscle in tiny or significant amounts, complete the bare minimum to activate local (muscle-specific) and systemic (hormonal) development processes Physical recreation is not exercise. Exercising involves performing MED to produce a targeted change . Ground Zero No Tracking = No awareness = No behavioural change tracking the ratio of body composition and not weight. Ask yourself, " How much is a useful muscle, and how much is useful fat? " four principles of failure proofing make it conscious , beware in real-time and not after the fact. For example, taking a picture of what you're about to eat will make you think twice. Make it a game , measurement = motivation. Seeing any changes in numbers creates a positive feedback loop to make it competitive. The potential loss is a more f...