Book Review: Mockito Essentials by Sujoy Acharya
Mockito essentials is a straightforward insight towards writing proper form of unit tests using mockito framework. Targeted at existing developers, this book goes beyond the documented library and explains the method of correctly writing unit tests and its corresponding code.
The book starts by introducing test doubles, or assumptions that we make while writing unit tests which is essentially done through mockito, effectively laying the foundation of the book. Two subsequent chapters are devoted to the innards of the framework - which is very handy if you have mockito's programming reference ready.
However, the main problem of unit test lies in its implementation as real world code is generally not testable and often is unchangeable. Using mockito under BDD tests is also worth mentioning as this concept is not covered elsewhere till now. The book concludes with implementation of mockito based tests over webservices and rich client applications.
Overall, the book not only covers the mockito framework but also covers practical advice regarding testing existing code and making both legacy and new code testable and I'd highly recommend this book if you are looking to write unit tests in java applications.
Disclaimer: I received a copy of this book from packt publication before doing a review.
Access the book here:
http://bit.ly/1IoUXzo
Musings on computers and software as I continue learning and sharing software development knowledge.
Showing posts with label book review. Show all posts
Showing posts with label book review. Show all posts
Tuesday, January 27, 2015
Tuesday, December 30, 2014
Book Review: Learning Python Testing by Daniel Arbuckle
This is a review of Learning Python Testing by Daniel Arbuckle which as its name suggests, delves into testing with python. The testing frameworks covered are already covered in comprehensive python texts but instead of only high level overview, this textbook covers various testing frameworks and approaches in detailed manner.
The first chapter covers various forms of testing - something which could be covered in few subtopics and test driven development could have been discussed in greater detail. It then moves into doctest, which is unique approach in python and was discussed in depth - I've only known it vaguely before and the provided details opened up a sea of possibilities for me. For instance, the AVL tree example provided an excellent demonstration of doctest and is worth quoting. The next chapter provided unit tests with doctest and correctly explained the essence of unit testing. The PID controller example however was confusing and it took me frequently eyeballing the code - the logic used was complicated and consequently the test cases were larger. Next, mock objects were detailed - which are not present in other python texts. unittest.mock library in python3 was explained in depth before covering the details of this module. In the next chapter, the Nose test runner was discussed and its various customizations were also explained.
Test Driven Development was introduced relatively late in the book after all the testing frameworks were covered and covered writing specification and tests before code. For someone new to TDD philosophy, this book offers excellent introduction and covers all its facets and challenging the reader to do more - which I found as a pleasant surprise. This was followed by integration and system testing doctrine. The final chapter covering importance of testing in code coverage, version control and continuous integration wrapped up this handy textbook sufficiently.
Apart from some places where I found the text opinionated with the example taken, I enjoyed the rest of the book and specially places where the reader is asked to get off reading and try things to test his/her knowledge of the topic.
Disclaimer: I received a copy of this book[http://bit.ly/1HKQaIj] for doing its review.
The first chapter covers various forms of testing - something which could be covered in few subtopics and test driven development could have been discussed in greater detail. It then moves into doctest, which is unique approach in python and was discussed in depth - I've only known it vaguely before and the provided details opened up a sea of possibilities for me. For instance, the AVL tree example provided an excellent demonstration of doctest and is worth quoting. The next chapter provided unit tests with doctest and correctly explained the essence of unit testing. The PID controller example however was confusing and it took me frequently eyeballing the code - the logic used was complicated and consequently the test cases were larger. Next, mock objects were detailed - which are not present in other python texts. unittest.mock library in python3 was explained in depth before covering the details of this module. In the next chapter, the Nose test runner was discussed and its various customizations were also explained.
Test Driven Development was introduced relatively late in the book after all the testing frameworks were covered and covered writing specification and tests before code. For someone new to TDD philosophy, this book offers excellent introduction and covers all its facets and challenging the reader to do more - which I found as a pleasant surprise. This was followed by integration and system testing doctrine. The final chapter covering importance of testing in code coverage, version control and continuous integration wrapped up this handy textbook sufficiently.
Apart from some places where I found the text opinionated with the example taken, I enjoyed the rest of the book and specially places where the reader is asked to get off reading and try things to test his/her knowledge of the topic.
Disclaimer: I received a copy of this book[http://bit.ly/1HKQaIj] for doing its review.
Thursday, July 17, 2014
Book Review: 'Real Time Communication with WebRTC'
I am presenting the review of the book, 'Real Time Communication with WebRTC' by Salvatore Loreto and Simon Pietro Romano.
This book is an interesting mix of both Theory and Practical components of WebRTC, better explained to a layman as Voip or skype within a browser.
One of the things that could really affect you as a reader is the way this book is written - the theoritical fundamentals are interspread with code and practical advices. At times this makes a seemingly straightforward topic like socket.io painful to understand, but this is quite handy if you are stuck at a specific problem and need to go deeper into it.
As I am already having experience in developing applications that utilize WebRTC, it was a refreshing read that also explained a lot of theory details associated with this technology and the various possible ways in which peer-to-peer audio and video can be shared on a real time basis.
To give you an overview of this book, it gives a long introduction to the users and handling of user media(mic and webcam) from a HTML5 browser, before starting the discussion of the different design strategies used in a peer-to-peer connections. It then runs the user through an application from scratch to increase his confidence over the topics discussed and finishes with a discussion of advanced features of WebRTC API.
My greatest peeve in using this book was the lack of authority in the examples - some examples failed to execute with the firefox browser. Also, some of the routinely occuring errors could have been added as this technology is constantly evolving and it is not unexpected to find some code that might not be supported by future versions of browsers.
However, the browser based peer-to-peer communication is completely discussed and this book is one of the most comprehensive text on it at the moment.
Disclaimer: I have been provided a free copy of this book by OReilly under their Blogger review program.
This book is an interesting mix of both Theory and Practical components of WebRTC, better explained to a layman as Voip or skype within a browser.
One of the things that could really affect you as a reader is the way this book is written - the theoritical fundamentals are interspread with code and practical advices. At times this makes a seemingly straightforward topic like socket.io painful to understand, but this is quite handy if you are stuck at a specific problem and need to go deeper into it.
As I am already having experience in developing applications that utilize WebRTC, it was a refreshing read that also explained a lot of theory details associated with this technology and the various possible ways in which peer-to-peer audio and video can be shared on a real time basis.
To give you an overview of this book, it gives a long introduction to the users and handling of user media(mic and webcam) from a HTML5 browser, before starting the discussion of the different design strategies used in a peer-to-peer connections. It then runs the user through an application from scratch to increase his confidence over the topics discussed and finishes with a discussion of advanced features of WebRTC API.
My greatest peeve in using this book was the lack of authority in the examples - some examples failed to execute with the firefox browser. Also, some of the routinely occuring errors could have been added as this technology is constantly evolving and it is not unexpected to find some code that might not be supported by future versions of browsers.
However, the browser based peer-to-peer communication is completely discussed and this book is one of the most comprehensive text on it at the moment.
Disclaimer: I have been provided a free copy of this book by OReilly under their Blogger review program.
Thursday, June 5, 2014
Book Review: Client Server Web Apps with Javascript and Java
The book, 'Client server Web Apps with Javascript and Java' by Casimir Saternos aply provides its puchline, 'Rich, Scalable and Restful'. These words do not only cover the essence of this book, but also describe the adoption of Javascript based frameworks and technologies on the user-interface/frontend of today's Enterprise Java applications.
A new term is used to introduce the users - Client-Server, which signifies that client side of an application is as important as its server side and the amount of programming efforts required on the client side is also as big as it is managed on the server. It is similar to the other topics that are introduced in this book - completely from scratch, which enforce learning familiar concepts like JavaScript refreshing to learn.
Even for an experienced developer, there are lot of things to watch out for like in chapter 2 where excerpts from 'Javascript: The Good Part' by Douglas Crockford are cited for concise learning. Similarly, in the next chapter detailing REST and JSON, the non-existence of url/syndication in JSON and its related debate surrounding HATEOAS (Hypermedia As The Engine Of Application State) is explained. The JVM specific languages are mentioned by highlighting build tools related to them, which is potentially confusing if the person reading is not familiar with build, version and test tools.
The next part of the book starting with Chapter 5 deals with the client side web application and quickly introduces the user towards finer points like asset pipelining and is followed up on the next chapter by introducing different JVM based servers to run and deploy the web application. Lightweight Java servers and developer productivity tools are listed in the couple of following chapters, which I think do not add much value to the overall premise of the book. The next chapter then covers the design and principals of RESTful web services and demonstrates one created in Jersy which is then followed up by jQuery.
However, the Chapter 10 covers Angular and Sinatra (a mini-web framework in ruby) which is a let down as Java8 has provided native node.js runtime through project Rhino and it would have been interesting to see angular being used in the full MEAN stack (MongoDB, Express.js, Angular.js and Node.js) as express.js is the De-facto framework in the node.js land and angular and express share quite a lot in common. That said, beginners to Angular should use this chapter to get a feel of angular and do not worry much about the choice of server side framework used to provide the RESTful service to the client side application in question. This chapter covers Angular.js in sufficient detail and covers the actual theme of the book but at the end of the chapter, as a user I am left wanting for more - especially given the multitude of client side frameworks available as of today. I will definitely keep an eye open for improvements in this chapter in the future revisions of this book.
The final three chapters deal with the packaging and deployment and touches these areas briefly - it covers just the starting pointers and the users can themselves choose the tools to learn further as they need more.
Another plus I found with this book was a well balanced Appendix - on one hand, practical examples on using different lightweight databases were given and on the other hand, various facts and trivia regarding REST was detailed.
Overall, this book is a gem of knowledge to existing/new programmers who are starting looking into the exciting world of client side javascript based webapps that interact mainly with lightweight web services.
For a few sections where a simple Java based Restful service is demonstrated, sinatra running on jRuby is created which is fine, but can potentially confuse some java programmers who are not familiar with the ruby/jruby landscape. Instead, some offshoot library of Sinatra created in Java could've been used. This apart from the smaller chapter 10 and the fact that any other client side framework and tools like grunt/bower have no mention is my main grouse from the otherwise stellar book that deserves a read for those who are starting up on new age web apps.
Disclaimer: I have been provided a free copy of this book by OReilly under their Blogger review program.
Sunday, January 26, 2014
Book Review: Ruby Under A Microscope
Ruby Under A Microscope
Author: Pat Shaughnessy
During the past few weeks I've been reading this book, 'Ruby Under A Microscope' by Pat Shaughnessy which covers internals of virtual machine used by different implementations of Ruby programming language. I would consider myself lucky to have an opportunity to review this book under the Oreilly's blogger review program as this is a must-read for any Ruby developer and specifically to someone doing a Ruby vs Java comparison. While the virtual machine internals and algorithms used are widely discussed and known in Java, the same cannot be said for Ruby and Ruby developers generally shrug it off when confronted with interpreter/platform specific issues and seek refuge with changing/scaling up resources.
Detailing of internals help in understanding the behavior of the language as the optimizations made internally by the compiler have a direct bearing on the behavior of the program and can exhibit unexpected behavior. What is of peculiar interest here is that this book delves into the internals down to the compiler in order to understand the resultant behavior/performance.
The book starts with the tokenizing and parser mechanism preset in ruby and continues to the compilation of interpreted script into YARV instructions. This is then explained in next chapter where the program call stack and variables used internally is detailed.
Control branching and method dispatch are discussed before the discussion moves into Class, Object and Method mechanism. The hash mechanism used to save objects by ruby is detailed next before blocks are discussed and Lambda and Procs are discussed together with Stack vs Heap memory. This is followed with advice which is worth reading for those not familiar with metaprogramming ruby and while this is not as verbose as 'Metaprogramming Ruby', it does a good job explaining various reflection based constructs.
After covering the language internals, two of the leading platforms, JRuby and Rubinius are detailed and compared against MRI(YARV). Lastly Garbage collection is discussed and comparison between ruby and java garbage collectors is discussed. Pat really does well in explaining the differences and also provides ideas to explore things based on the GC profile report here. I'd also advise to check out his blog for more such topics.
I'd heartily recommend this book to anyone who is interested - from students to expert pros alike as anyone coding/using Ruby ought to know its internals and have more confidence in developing and using this platform for non-trivial tasks.
Disclaimer: This book has been provided me by OReilly under their Blogger Review program.
Friday, April 5, 2013
Book Review: Jump start sinatra
The book is a good starting point for a new as well as intermediate experts having background in developing web applications in ruby.
However, this book assumes a basic level of competency in developing web applications as it is obvious from the very less emphasis placed for discussing over concepts like git, css, javascript and html. Since it assumes that a user knows ruby and has a basic idea if not familiarity with Ruby On Rails, rather than repeating basic information all over again, the focus is more on latest tools such as heroku, sass, coffescript that are more complex, but are more relevant if seen from a point of an intermediate or professional developer.
The book is centered around end to end application development of a sample website and lays emphasis on adding new features over it during the course of different iterations as is done in real life.
Considerable mentions go to deploying the website over Heroku as well as introduction of DataMapper ORM.
While this incremental approach of building a sinatra powered application makes perfect learning for beginners, lack of pointers related to advanced solutions, tackling issues like setting up environment, debugging, etc are felt as the books usability seems constrained by the simplistic pattern it adopts.
After a high level introduction, a basic website is created, using different views. Next, a basic CRUD functionality with database is exposed and the application is deployed live, this is followed by additional DRY concepts available in sinatra and the book caps off its learning with creating modular sinatra applications and enhancing its functionality by demonstrating a custom framework.
Overall, this is a 150 page neat and to the point book for people interested in sinatra.
Note: This book has been provided to me for reviewing under the Oreilly Blogger Review Program.
Saturday, March 9, 2013
Book review: Effective Monitoring and Alerting
I've just finished reviewing the book, 'Effective Monitoring and Alerting' by Slawek Ligus, published by O'Reilly Media.
This deals with System Operations and administration. Given the importance that maintenance of production software commands these days and the emerging convergence of developers and operations; thanks to the devopts movement which has gained a fare amount of traction, the importance of this text cannot be underestimated.
The author presents the concepts in a technology agnostic manner and focuses on latest trends in operations.
The book gives you a short, high level overview of the topic in 150 pages and covers the common tasks involved in monitoring and alerting of operations.
It starts with the introduction of monitoring and alerting and the issues surrounding these concepts. Over the next few chapter, monitoring and alerting is discussed with greater detail and explanation about interpreting the monitoring as well as understanding the nuances of alarms are given.
After these topics, the implementation, challenges and implications of scaling these on a large basis is discussed by some sane advices obtained from real world projects. These are then closed off by displaying the principles that capture the essence of the topic.
Get in the habit of measuring
Draw Conclusions Reliably
Monitor Extensively
Alarm Selectively
Work smart, not hard
Learn from the experiences of others
Have a tactic
Run a bank of cases
Enjoy the process
While these might come as common words of advice; these were presented in a practical yet succinct manner.
As the book focuses on a niche that involves guesswork and intuition from non system administrators towards understanding these concepts, it provides a lot of insight that senior administrators can impart. While the book focuses on theory in all the chapters, setting up Open TSDB is given as an appendix, I've gone through this and it is different from what is generally available in the blogs and online tutorials as it covers the setup from the perspective of actual deployment rather than focusing on a specific technology(like hbase or nagios) used in the exercise.
Overall, this was a power packed guide that covered various concepts but took off from advanced level in various concepts, leaving me lost in few areas where I do not have any prior experience .
Disclaimer: I received a copy of the book under the Blogger Review Program - O'Reilly Media.
This deals with System Operations and administration. Given the importance that maintenance of production software commands these days and the emerging convergence of developers and operations; thanks to the devopts movement which has gained a fare amount of traction, the importance of this text cannot be underestimated.
The author presents the concepts in a technology agnostic manner and focuses on latest trends in operations.
The book gives you a short, high level overview of the topic in 150 pages and covers the common tasks involved in monitoring and alerting of operations.
It starts with the introduction of monitoring and alerting and the issues surrounding these concepts. Over the next few chapter, monitoring and alerting is discussed with greater detail and explanation about interpreting the monitoring as well as understanding the nuances of alarms are given.
After these topics, the implementation, challenges and implications of scaling these on a large basis is discussed by some sane advices obtained from real world projects. These are then closed off by displaying the principles that capture the essence of the topic.
Get in the habit of measuring
Draw Conclusions Reliably
Monitor Extensively
Alarm Selectively
Work smart, not hard
Learn from the experiences of others
Have a tactic
Run a bank of cases
Enjoy the process
While these might come as common words of advice; these were presented in a practical yet succinct manner.
As the book focuses on a niche that involves guesswork and intuition from non system administrators towards understanding these concepts, it provides a lot of insight that senior administrators can impart. While the book focuses on theory in all the chapters, setting up Open TSDB is given as an appendix, I've gone through this and it is different from what is generally available in the blogs and online tutorials as it covers the setup from the perspective of actual deployment rather than focusing on a specific technology(like hbase or nagios) used in the exercise.
Overall, this was a power packed guide that covered various concepts but took off from advanced level in various concepts, leaving me lost in few areas where I do not have any prior experience .
Disclaimer: I received a copy of the book under the Blogger Review Program - O'Reilly Media.
Tuesday, August 21, 2012
Book Review: Hadoop: The Definitive Guide, Second Edition by Tom White
Anyone interested in big data management today has at least a passing familiarity with Hadoop, an open source map-reduce algorithm implementation. Here's my review of the second edition of one of the most comprehensive books on the topic.
As a longtime hadoop enthusiast, I already had read the first book, I was interested in finding out what this second edition has in store for the readers.
The book builds over its predecessor and apart from addition of Hive and Sqoop, a case study covering graph visualization in social networks has been added. The hadoop version has been updated, as a developer, I'd recommend latest stable release of hadoop as it is an active project. However, as Tom White is himself a committer in this project, various project insights are added along the way as in the original edition.
From the first time hadoop adopter's point of view too, this text is an easy to adapt and the learning curve of hadoop is lessened to a great extent.
The book starts by building the context, presenting the history and ecosystem of hadoop and gives its user a high level overview. The underpinings of hadoop, or the mapreduce algorithm and its implementation in hadoop is covered in the next few chapters. This contains practical aspects of running any hadoop application including HDFS file manipulation and map reduce operation in detail. An exhaustive list of mapreduce techniques alongwith their examples are then covered that come up in everyday development while using hadoop api to interface with big data.
Another highlight of this book is the comprehensiveness of running and deploying hadoop in various configurations. Also, closely knit data management tools in the hadoop ecosystem or its sub-projects such as pig, hive, hbase, zookeeper and sqoop have been covered.
This is followed by various case studies that make an interesting read. It was disheartening to see no major updates in the case studies compared to the previous edition .
From a person already having the original edition of this book, the second edition does not have much to cover, but for a person not having read any previous editions, this is a comprehensive book.
Note: This book has been provided to me for reviewing under the Oreilly Blogger Review Program.
Wednesday, August 24, 2011
Up Next : Book review on Play framework
Today I received a copy of the book, 'Play Framework Cookbook' by Alexander Reelsen, courtesy its publisher, Packt Publications.
As the name suggests, it covers various recipes regarding the play framework, which is a promising rapid application development framework in java/scala platform.
This is the first instance of any good documentation of this upcoming framework for professionals and looks promising. I will be going over this book for the next few days and would be posting my views about it, stay tuned!

This is the first instance of any good documentation of this upcoming framework for professionals and looks promising. I will be going over this book for the next few days and would be posting my views about it, stay tuned!
Labels:
book review,
packt publications,
play,
play framework
Subscribe to:
Posts (Atom)


