A co-worker asked about code organization in Functional Programming. He’s working with a bunch of Java developers in Node for a single AWS Lambda, and they’re using the same style of classes, various design patterns, and other Object Oriented Programming ways of organizing code. He wondered if they used Functional Programming via just pure functions, how would they organize it?
Continue reading “Code Organization in Functional Programming vs Object Oriented Programming”
Next, Logging, and Conclusions
Welcome to Part 6, the final installment in this series. Below we cover unit testing the noop
next, how to create pure functions that wrap
noop so you can compose them, and finally using code coverage to strategically hit the last code that’s not covered.
Continue reading “Functional Programming Unit Testing in Node – Part 6”
Noops, Stub Soup, and Mountebank
Welcome to Part 5 where we cover more about noops with a utility to test them, the “stub soup” that can happen if you don’t create small pure functions, and how we can utilize stubs instead of mocks to unit test larger functions. The most important part, though, is setting up Mountebank to show how integration tests can show problems in your unit tests despite 100% coverage. We use wrapping
class instances as an example to show you the pitfalls Object Oriented Programming code can make for you.
Continue reading “Functional Programming Unit Testing in Node – Part 5”
Concurrency, Compose, and Coverage
Welcome to Part 4 where we show how to do concurrency which is a lot easier to get “for free” using pure functions, we compose both async and synchronous functions, we and utilize a test coverage report to where next to focus our refactoring and testing efforts.
Continue reading “Functional Programming Unit Testing in Node – Part 4”