/apprentice-boot-camp-improving-code

Primary LanguageC#Creative Commons Attribution Share Alike 4.0 InternationalCC-BY-SA-4.0

Competencies, Behaviours and Knowledge units

  • TC10: Applying Good Practice
  • TC1: Logic
  • TC6: Design
  • Knowledge 1.1 (‘Designing for software maintainability and re-use’ aspect)

Resources

  • Slides
  • Laptops
  • Internet access
  • Post-its
  • Pens
  • Whiteboard
  • Paper
  • Sticky tape

Mentors / Languages

Two–three mentors required in addition to leads. These should be able to cover support for the required languages.

Prep-work for apprentices

See here

Follow-on tasks

Organisation mentors should look to exercise the knowledge we’ve covered in the boot camp. Below are suggestions for tasks that would do this, but please use your own judgement to work out what to do. There is no need for anything to be returned to MD or the presenters—it’s just a learning exercise.

  • Search for code smells in code-bases back at work
  • Apply code smell searching and refactoring to portfolio work and document
  • Maybe use QWAN cards as a teaching resource to help organise refactoring work
  • Apprentices should deliver a code review, and receive feedback about it
  • Configure / review static analysis for an existing reasonably sized project (use Codacy if no existing system in use and the code is publicly available)
  • Java apprentices can also add Error Prone to an appropriate project—maybe one in it’s early days so that it is possible to introduce
  • You could code review their changes in the Code Smell trivia exercise—they can provide you with the address for their fork
  • You can see how they reviewed each other’s changes in the exercise—one again they can provide you with a link to their comments

Further reading / learning resources

Books:

Video:

Web:

Slides

The slides can be viewed from the link at the top of the repository.

Exercises

  • Reading Trivia code base to understand
  • Identifying and removing code smells in Trivia code
  • Setting up static analysis for codebase
  • Identifying and removing more code smells in Trivia code
  • Providing code review

Boot Camp Summary

Planned

  • Refactoring
  • Static Analysis
  • More on Coupling
  • Code Smells
  • Legacy Code
  • Design Patterns

Not covered

  • Design Patterns
  • More on Coupling

Briefing for organisation mentors

  • Familiarise yourself with following code smells using this site
    • Uncommunicative Name
    • Duplicate Code
    • Magic Number
    • Long method
    • Conditional complexity
    • Large class
  • Familiarise yourself with the Trivia code base
    • Maybe try refactoring it?
  • Understand what the golden master test does, and how to regenerate the golden masters
    • May need to do this if bugs are identified and fixed
  • Try setting up www.codacy.com on one of your repos, or a fork of this one

Working with the slides

The slides are stored as Markdown files in docs/_posts and are presented using a combination of Jekyll and reveal.js. A remote Jekyll theme is used to help make changes to the Jekyll code centrally.

The easiest way to preview your changes locally is to use docker to run Jekyll. To do this, install docker if you haven’t already and run docker-compose up from the root of this project in a terminal. Your changes will be visible on http://localhost:4000/. Any changes you make to the slides will be reflected in your browser—there’s no need to restart docker. You can hit ctrl-c to stop the process.

Once you push your changes the slides will be published using GitHub Pages automatically (see the link at the top of the repository).