ReSharper Architecture Tools

JetBrains introduced Architecture tools in Resharper 8. It lets you visualize dependencies between projects and types.

To start using it, open a solution in Visual Studio and go to Resharper – Architecture menu. “Show Project Dependency Diagram” menu item opens a new tab with graph of project dependencies:

resharper-architecture-2

Continue reading

Software Archaeology

Human civilization history dates thousands of years. Archaeologists strive to investigate fragile clues of former cultures in order to better understand the past. It is not easy to do because many artifacts are partially or completely destroyed.

It would be a mistake to think that only archaeologists deal with information loss. It is as easy to lose information about systems and organizations which were built quite recently, just a few years ago. In “Institutional memory and reverse smuggling”, an engineer tells a story about a petrochemical company where knowledge about plant design and processes was lost after decades of operation, and they had to bring in a former engineer to smuggle the knowledge back to the company.

Continue reading

Refactoring Databases

Even if you had perfect database design from the start, it is likely that requirements changed, and you have to change database schema accordingly. As there is legacy code, there can be legacy data, with schema designed for use cases which are no longer actual.

It is usually harder to fix data design than to fix code design, but it is doable. And as with code, you can apply refactoring techniques: improving the design without change in behavior.

A book “Refactoring Databases: Evolutionary Database Design” describes basics of database refactoring and lists different kinds of changes to relational databases. It starts from explanation why refactoring is a good thing, why it is important to make small incremental changes, and which organizational obstacles you can get on the way of implementing these techniques. You can imagine how hard it can be to make database changes if DBA and application developers are in different teams, and any database change requires coordination between these teams, sometimes using strict change management process. Basically, agile methodologies with their focus on cross-functional teams and short development cycles can help here.

Continue reading

Performance Tests for Web

How can you find if your website is fast enough? You would like to know an answer to this question before angry customers start complaining in social networks, and probably even before your code is deployed to the production environment.

There are two kinds of tests which can be useful: individual web page performance tests and load tests.

Performance of a web page is usually measured in a real web browser. One of the popular tools to automate such tests is WebPageTest. WebPageTest starts a new instance of chosen web browser, for example, Chrome, navigates to specified URL and waits for the page to complete loading. Loading here includes receiving HTTP response, CSS styles, JS scripts, images, fonts and all other stuff on the page, then rendering the page and executing scripts. WebPageTest measures time to render, time to full complete, number of HTTP requests and few other metrics; captures a timeline of loading of different resources and opening/closing HTTP connections. It can also capture video of page loading and a screenshot. Then it starts the process again to measure repeat visit: it is usually faster because some resources are already cached by the browser.

Continue reading

Working with Legacy Code

Do you work with legacy code? You might ask, what legacy code is. It is a good question with many different answers:

-          Code which is using outdated languages, technologies, libraries, APIs, e.g. COBOL programs;

-          Old code

-          Code which was written by another team or developer

-          Code which has no documented requirements

-          Code not covered with automated tests

-          Messy code

-          Any code (“code becomes legacy as soon as it is written”)

So the definition is a little bit vague. Usually legacy code has few of these properties: old code, written by developers who no longer work for the company, without documented requirements, without tests, built on top of an old technology platform.

Continue reading

Artificial Intelligence

Since computers have been invented, geeks don’t stop talking about artificial intelligence (AI). Indeed it is cool to have a machine which helps human beings with cognitive activities.

There are two types of AIs: strong AI (general AI) which can perform any intellectual task that a human can, and weak AI which is designed to solve specific tasks.

Weak AIs are already here. Chess programs play chess better than the best human players, pocket calculators multiply numbers better than the best mathematicians, IBM Watson wins human players in Jeopardy and helps doctors to treat cancer. Machines start working on more and more tasks which were previously considered as entirely human work.

Continue reading

Object Detection Using Neural Networks

Recently I described how to use neural networks to recognize handwritten digits from MNIST dataset: Neural Network Training Using encog.

One of real world usage of machine learning is image detection: find object location on the image. Facebook finds faces on photos; Google self-driving cars detect pedestrians, cars and traffic signs.

I tried to use a neural network to detect eyes on photos. Yes, I know that there are many tools in various computer vision toolkits which are good to solve this problem, but I want to try generic object detection problem, and not focus just on face recognition. Though I’m good in software engineering, machine learning is very new field for me, and this is my first practice in image detection.

Continue reading

Beauty of Testing

Steven Sinofsky wrote a nice post about software testing: http://blog.learningbyshipping.com/2014/09/25/beauty-of-testing/

Steven defines testing as “verification that a product does what it is intended to do and does so elegantly, efficiently, and correctly” and as “the conscience of a product“. Does it sound about right? Yes, usually software testers verify that software works as defined in specification/requirements/user stories/whatever. But it is not all that can be done. It is quite easy to build a product which does exactly as defined in the spec, but at the same time is useless for customers, or is not profitable for the company which develops it. Systems engineering defines that lyfecycle of the system contains verification and validation as separate logical stages. Validation here is checking that a product satisfies stakeholder needs. Validation is probably something testers must do as well.

Continue reading

How To Start Learning Machine Learning

Just a few links to various resources which may be useful for learning machine learning (pun intended).

Machine Learning course by Andrew Ng on Coursera: https://www.coursera.org/course/ml

“The Elements of Statistical Learning: Data Mining, Inference, and Prediction” book http://statweb.stanford.edu/~tibs/ElemStatLearn/printings/ESLII_print10.pdf

 

Various guides for getting started:

http://thunderboltlabs.com/blog/2013/11/09/getting-started-with-machine-learning/

http://abeautifulwww.com/2009/10/11/guide-to-getting-started-in-machine-learning/

Continue reading

Bitcoin Mining

In previous post I started a discussion about Bitcoin, though did not provide details on what actually Bitcoin is and how it works. There is much information on this in the internet. You can start with reading this wiki: https://en.bitcoin.it/wiki/Introduction or read a whitepaper for technical details: https://bitcoin.org/bitcoin.pdf

Bitcoin is based on an idea of a public ledger (blockchain): a list of all transactions ever happened, publicly available for everyone in P2P network. To prevent double spend there should be a way to make sure that only one blockchain exists. Blockchain solves this problem by using something called “proof of work” https://en.bitcoin.it/wiki/Proof_of_work . Large amount of computational work is required for a new block to be accepted into blockchain, and all bitcoin clients have the same understanding of how to validate new blocks, and how to check proof of work. So in order to compromise bitcoin protocol an attacker must control more than 50% bitcoin client computation power.

Continue reading