Category Archives: elixir

Meet Blitzy: not so simple HTTP load tester in Elixir

Reading Time: 2 minutes

TL;DR

In this post I present Blitzy, not so simple HTTP load tester in Elixir. This is my open source contribution to original Blitzy, simple HTTP load tester in Elixir.

My journey with Elixir started six months ago. With proper book from The Pragmatic Bookshelf, this was fun experience. I made myself to do all exercises, but in the end I skipped Macro exercises. How to test my Elixir practical knowledge? The best way is to contribute to some of Elixir open source project.

For one of my clients, I need to do load, duration and concurrent test. I previously used Grinder, Java Load Test Framework. Driven by pure curiosity, I searched for load testing tool in Elixir, and I found Blitzy.

It has simple feature set, do load test for simple http get. By exploring the code and using Programming Elixir 1.3 as a reference, I found out that I can read and build Elixir project code. So, why not add features to Blitzy that I need for my current project.

My first contribution was to update dependencies, and do some refactor because some libs changed their interfaces. This was need just to build Blitzy for current set of features.

In closing session of CAST 2016, there was discussion how can we help to enhance software testing. My contribution, lets create software testing tool, that can be easy to extend, develop and maintain. Another pointer for Blitzy contribution.

Power of Blitzy is that is programmed in Elixir, which uses Erlang virtual machine. Downsize of Erlang is rather cryptic programming language, it feels that you are writing mathematical formulas and proofs, and not a program. But there is Elixir, that resolves that issue.

Blitzy codebase is small, because it uses Erlang virtual machine concurrency and code distribution out of the box features.

I remember that most of the code for Grinder was about those features, distribution and concurrency.

Check github repository, and happy load testing.

I wrote tests for Blitzy, currently line coverage is more that 80%, but I have not wrote most important test that include data. How about that metric preachers? Important unit test are on to do list.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Elixir learning path

Reading Time: 2 minutes

TL;DR

I started my Elixir functional language learning path. My goal is to learn Phoenix framework, and this is precondition. I will explain why I found that Elixir School is not a good fit for functional programming absolute beginner.

Important note: feature image features my daily elixir, which is good craft beer. Remember that this contains alcohol and you need to enjoy it responsible as legally major person.

Elixir learning page gives several options how to start. I started with Elixir School, and as absolute beginner in functional programming I lost them at matching patterns in case statement. Pattern matching is core feature for functional programming. Elixir school gives you examples, with no additional explanation. I think that precondition is that you know functional programming, and if this is true, they should state it this fact at the beginning of the lectures.

As a software tester, I read a lot about how to effectively learn something. You should always start with a book. Elixir official page listed Programming Elixir 1.2 as first resource. My heuristic was, “Does that mean that this is best option?” In order to check my fallible heuristic, I googled “best book to start Elixir” and found recomendation blog posts for this book.

So far so good. I am satisfied with book and author. Here are my notes for first chapter and my note taking tools:

tools_1

 

 

 

tools_2

 

tools_3

 

 

What I liked so far:

Instead, it is intended to give you enough information to know what questions to ask and when to ask them. So approach what follows with a spirit of adventure. Try the code as you read, and don’t stop there. Ask yourself questions and then try to answer them, either by coding or searching the Web.

Dave Thomas. Programming Elixir 1.2 (for Karlo Smid) (Kindle Locations 561-563). The Pragmatic Bookshelf, LLC (586659).

And:

The foundations of programming are not assignments, if statements, and loops.

Dave Thomas. Programming Elixir 1.2 (for Karlo Smid) (Kindle Locations 572-573). The Pragmatic Bookshelf, LLC (586659).

Conclusion

We recently had workshop on taking notes. One of the conclusion was is that you need to practice in order to create great graphically enabled notes that will help you to better understand them. Before every new chapter, I will use notes to recap what I learned in previous chapter and to use them as my Elixir reference.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather