testing

Testing Software – Best Practices

Garda Lake

Some (raw) thoughts on what are the elements that give you a quality and testable code.
It’s not a full list of TODOs but some best practices that should serve you as a good baseline. If you have any suggestions, please feel free to comment.

Tests

If we agree that you must have tests in your project – The next good question is what is a good test?

  1. It’s FAST – The tests should run fast in order to encourage developers to use them constantly during the development process.
  2. Stable – The test doesn’t break often. You wish to minimize the false-positive ratio as much as you can. This is why you need ‘small’ tests that are encapsulated and give you a clear sign on what is working (or not).
  3. Easy to read and understand.
  4. Catches Bugs! When a test fails it’s most probably a bug.

Continue reading

Advertisements
Standard
webdev

Useful Google Sheets Functions

water falls

From time to time you want to get more from your data in Google Sheet. It might be some information you collected from a form or any other spreadsheet with data you wish to work on. Here are some useful functions for common tasks.

1. Return the last row

There is no specific function to return the “last row” – but this hack is working perfectly.

=INDEX(A:A,COUNTA(A:A),1)

2. Joining text

Useful for all the cases where you have first name and last name in 2 columns and you wish to join them.

="this name " & A1 & “ plus this extra name ” & B1

or if you have cells you wish to merge into one with a certain delimiter:
=join(“;”,A1:A5)

3. Import any RSS, HTML or CSV data Continue reading

Standard
testing

Code Without Tests?

Code without tests is bad code. Even if it’s looking clean and efficient. Without tests you can’t change it in a verifiable way.

You can’t know if your code is getting better or not.

It’s not a new idea.

But it’s amazing how many times developers will ‘cut’ corners or won’t implement tests because they are too busy to ship a new feature.

In many cases, it’s the opposite case, if you wish to move faster and safer – you need a good tests suite that give you the confidence that your changes didn’t break anything. You wish to have unit tests (wide coverage of functionality and running fast in an automated way), integration tests (a bit slower but still fast and in many cases, with mock data) and end to end tests (Yes, in many cases, in a real production environment). Continue reading

Standard
Business, life

Weapons Of Math Destructions

Weapons Of Math Destructions book

 

I have just finished this book “Weapons Of Math Destructions” by Cathy O’neil.

It’s an important book that deal with mathematical algorithms and models that control our modern life and where they threat to change many aspects of our social interactions. Think about cases like who is being selected to a certain collage and all the implications. She gives good stories and background to each example in the book.

To me, the bottom line is a call to developers, product managers, scientists (and anyone else who contribute to the creation of these systems) to take more responsibility when they building algorithms. I know it’s a real challenging aspect, as most people are not even aware to the tendencies that they got and influence their decisions. It’s also a call for the regulators to think and ask the hard questions about modern ‘AI‘ systems.

Overall, it’s a good book that is full with good stories and examples that drive her main points about the dark side of big data.

Give it a try.

You might like it as much as I did.

Standard
bots

Hey Google, Talk To Highway 80 Conditions

 

Next time you are driving to Tahoe you don’t need to open the phone, navigate to the browser and check if the road is closed (or not).

You can just ask the Google Assistant: “Hey Google, Talk To Highway 80 Conditions”.

You will get the most updated data about the road like in the example below:

Screenshot 2018-03-22 11.38.28

Please ignore the text formatting (which I’ll improve in the near future) as it should be use as voice only while you are driving.

Check it on the Google Assistant or on the web here.

If you are using Telegram check this.

Be safe!

 

Standard
Business, life

Good Podcasts

headset with colors in the backgroundYesterday I had an interesting conversation with a friend about ways to improve your knowledge in different topics.

I suggested to him to leverage his long commute or runs to listen to audio books and podcasts. I have been doing it over the last 15 years and it’s a great way for me to utilize time better. Suddenly the long runs become interesting and time flies. So his next question was what are the podcasts I like and why.

Here are the top ones:

  • Revisionist History is my favorite one. Gladwell does what he is excelling at… telling a story you think you knew but turn it on its head and during this process teach you a thing or two. In the last two seasons, Gladwell went back and reinterpret something from the past: an event, a person, an idea. Something overlooked. Something misunderstood. The one on Martin Luther King is fascinating.
  • Freakonomics is an award-winning podcast with a lot of listeners (which most, I suspect, like logic, economic etc’). Stephen Dubner has conversations that explore the riddles of everyday life and the weird wrinkles of human nature — from cheating and crime to parenting and sports. Dubner talks with Nobel laureates and provocateurs, social scientists and entrepreneurs — and his Freakonomics co-author Steve Levitt. The last few episodes (as of March 2018) about CEOs are really good. Check it out.
  • Here’s the thing with Alec Baldwin – Alec really knows how to interview his impressive guests and listen to their ideas and stories. It’s great to follow him and learn about people that changed history, industries or ‘just’ put a smile on our faces.
  • Epicenter – I’ve been passion about the crypto world since 2012. Around early 2014 I found this one. It’s a podcast that takes you to the heart of this important technological revolution: the rise of decentralized technologies. Every week, they bring conversations with some of the brightest minds in this bourgeoning ecosystem of startups and open source projects. Good stuff if you want to learn more about decentralized technologies and the crypto world.
    Btw, Block Zero is a new podcast that deal with this topic as well. It’s still young but sounds good so far.
  • The Moth – The Moth Podcast features stories that are being recorded live on stage around the USA.
    Some of them are really good! Episodes are released every Tuesday.

Continue reading

Standard