Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

QA Fest 2019. Сергей Король. Mastering the Art of Reading Code

37 views

Published on

Reading source code is usually underestimated by many developers and AQA engineers as they are mostly focused on writing it.
Moreover, some people find reading someone else’s code boring, frustrating or even creepy. Others consider this activity a waste of time.
However, this is a common misconception which must be cleared. Do you want to know why? Are you still wondering how to master the art of reading code? Then come and hear it! This talk will be helpful for newbies who got stuck and don’t know how to start reading and understanding someone else’s code, as well as for professionals who want to structure their knowledge and learn some new patterns.

Published in: Education
  • Be the first to comment

  • Be the first to like this

QA Fest 2019. Сергей Король. Mastering the Art of Reading Code

  1. 1. MASTERING THE ART OF READING CODE
  2. 2. AQA Geek, mentor, speaker, consultant and open-source contributor. • Technical QA Manager • Consultant: http://sdclabs.com • GitHub contributor: sskorol Speaker’s info • Email: serhii.s.korol@gmail.com • Twitter: @ss_korol Contacts Sergey Korol Waverley Software ‘‘ 2 WHO AM I?
  3. 3. 3 3 701 contributions in the last year 34% code review HOW MUCH SHOULD I READ A DAY?
  4. 4. 4 4 THE PAOMNNEHAL PWEOR OF THE BIARN I cna elasiy rade tihs ifrontamoin. It manes taht oru barin has amiznag pewor! As I culod raed scuh pecie of txet woihtut ayn porlebm, I nac laren woh to rade ceod as wlel. Tsurt yuro biran adn it wlil ecixte yuo!
  5. 5. 5 5 THE BRAIN ACTIVATION WHILE READING
  6. 6. 6 Visual word form area (letterbox Access to pronunciation and articulation 6 THE BRAIN ARCHITECTURE FOR READING Visual inputsAccess to meaning
  7. 7. 7 7 WHY IT’S HARD TO UNDERSTAND CODE?
  8. 8. 8 8 MENTAL MODELS
  9. 9. 9 9 MILLER’S WALLET
  10. 10. 10 10 CONTEXT MATTERS I shoot people… And sometimes cut off their heads.
  11. 11. 11 11 COLLECTING METADATA
  12. 12. 12 12 DOMAIN KNOWLEDGE / REQUIREMENTS
  13. 13. 13 13 ARCHITECTURE
  14. 14. 14 14 PROJECT STRUCTURE Projec t ArtOfM RC.github kubernet esmysql ui-tests web frontend backend compone nts Projec t frontend public src assets web services stores Projec t backend e2e src auth web cache role user
  15. 15. 15 15 WHEN DO WE READ CODE?
  16. 16. 16 16 WHEN DO WE READ CODE? • Job interview • Project on-boarding • Specific solutions lookup • Articles / courses • Code review • Open-source
  17. 17. 17 17 WHEN DO WE READ CODE? • Job interview • Project on-boarding • Specific solutions lookup • Articles / courses • Code review • Open-source
  18. 18. 18 18 WHEN DO WE READ CODE? • Job interview • Project on-boarding • Specific solutions lookup • Articles / courses • Code review • Open-source
  19. 19. 19 19 HOW DO WE READ CODE?
  20. 20. 20 20 ABSTRACT AWAY FROM DETAILS
  21. 21. 21 21 • Pay attention to names • Avoid focusing on implementation details • Think about usage context • Describe what you see in a single sentence ABSTRACT AWAY FROM DETAILS
  22. 22. 22 22 PATTERNS RECOGNITION
  23. 23. 23 23 • Learn common design patterns • Locate common patterns in existing code base • Focus on your daily reading style and find out how does your brain optimize different code parts PATTERNS RECOGNITION
  24. 24. 24 24 DOWN THE RABBIT HOLE
  25. 25. 25 25 • Coding standards are finalized • Git flow is selected / hooks are configured • Branch / commit message conventions are set • Key branches are protected • Minimal amount of approvers is set • Code owners are assigned • Required checks are integrated into dev ToDo before code review integration: DOWN THE RABBIT HOLE
  26. 26. 26 26 • The code is well-designed • The functionality is good for users of the code • The code isn’t overcomplicated • There’s no code “for future” if it’s not required right now • Tests are present and well-designed • The code conforms style guides and name ToDo while reviewing someone else’s code: DOWN THE RABBIT HOLE
  27. 27. 27 CONCLUSIONS • Keep reading code to improve writing skills • Collect metadata to reduce reading effort • Practice abstract thinking • Learn existing / highlight new patterns
  28. 28. FIND OUT MORE LinksAuthor 28

×