luminousmen
I P

Ode to Unit Tests

The Law of Testing: The degree to which you know how your software behaves is the degree to which you have accurately tested it. -- "Code Simplicity" In order to verify the correctness of an application we use different kinds of tests: some check the logic of a small function or class, others check all the system layers from UI to databases and external services. Some kinds of tests could be...

Resolve cython and numpy dependencies on setup step

I have a custom Python package on my project where some functionality implemented on Cython. We use it to speed up some of the slowest parts of our code - the syntax is pretty close (it can be identical except some imports) to regular Python. Cython compiled to .so libraries and it has support for fast access to NumPy arrays. The problem - Cython and numpy packages need to be installed before...

How to estimate time for a project/task accurately

Most people do not know how to adequately assess the timing of tasks. Oh, how it makes them sometimes nervous ... Here, and "deadline sneaks up unnoticed." And they are reinsured for over 500% just in case (still not enough). And managers trying to squeeze "knowingly bloated deadlines," so that they can promise something more acceptable(common management disease). And vague muttering instead...

Basic architecture post

A simple post about the distinction between customer problem, created product and architecture solution. This is a problem: Problem is defined by customer functional and non-functional requirements. This is a product: A product is a defined set of features or capabilities that are used “as-is” directly by an end user. This is a solution: A solution is the application of one or more products to...

What Are The Best Software Engineering Principles?

Software Development Principles — it is a number of specific rules and recommendations, which engineers need to be followed during program implementation if they want to write beautiful, understandable and maintainable code. There is no magic wand, by which you can transform a mixture of variables, classes and functions into the ideal code, but there are some tips and hints, which can help the...

Optional arguments MUST use keywords (Python3)

Imagine that you are developing software for the big shipping company(why would you imagine small anyway). And you got a task to create a function for calculating a charge for ships based on their cargo weight. Easy breezy: WEIGHT_RATES = [ ( 10, 10.55), ( 5, 5.05), ( 2, 3.35), ( 0, 1.25) ] def shipping_charge(weight): if weight < 0: raise ValueError("Can't calculate shipping charge of...