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

What’s a simple way to share and learn refactor?

  I have been organizing coderetreat and creating screencasts on refactoring and TDD, etc… however, I find it takes lots of time and effort to organize, preparing and facilitate. (it’s not that I complain about it as a matter of fact I love it every single second and I’m amazed at how much I have learned from the community) I have been asking myself, what’s the simpler way for me to learn to refactor and share with others? (why refactor, you may ask? it’s because it’s my favourite topic in the long never-ending list of agile technical practices) and for some reason, I really like to share my boring meme jokes, so I guess why not share a list of animated gifs of refactoring and the motivation of it. I guess since I’m an Asian guy (hopefully some kind of descendants from Bruce Lee) so this saying is pretty cool to me: “I fear not the man who has practiced 10,000 different kicks once, but I fear the man who has practiced one kick 10,000 times.” Another way to look at it, from J.B Rainsber