What You Learned
Genetic Algorithms in Elixir — by Sean Moriarity (92 / 101)
👈 Writing Type Specifications | TOC | Chapter 13 Moving Forward 👉
In this chapter, you learned about how to use testing and code analysis to improve your framework and identify any bugs that might negatively affect your algorithms. You started by learning a little about randomness and how randomness can be difficult to test. Then, you learned how to use property-based tests to ensure your functions maintain some specified behaviors.
Next, you used credo to analyze your code for consistency and clarity. You also learned how to use the Elixir formatter to enforce Elixir’s style standards in your code.
Finally, you learned about typespecs and how to use dialyxir and typespecs to identify possible bugs in your code.
At this point, you’ve built a complete framework and learned how to optimize its performance and ensure your code is correct. You’ve learned how to solve many types of problems. In the next chapter, you’ll learn about genetic algorithms in the real world and how you can use the knowledge you’ve learned in this book in practical settings.
Footnotes
[22] https://github.com/rrrene/credo
[23] https://github.com/jeremyjh/dialyxir
[24] https://hexdocs.pm/ex_unit/ExUnit.html
[25] https://hexdocs.pm/stream_data/StreamData.html
[26] https://github.com/christopheradams/elixir_style_guide
[27] https://github.com/rrrene/credo
[28] https://hexdocs.pm/elixir/typespecs.html
[29] http://erlang.org/doc/apps/dialyzer/dialyzer_chapter.html
Copyright © 2021, The Pragmatic Bookshelf.
👈 Writing Type Specifications | TOC | Chapter 13 Moving Forward 👉
Genetic Algorithms in Elixir by Sean Moriarity can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

