Working with several customers over the past years, one of the NFR being enforced by customers is Code Coverage, some customers push for 80% while some others ask for 90%. Even had a client which asks for 95% in older days. Also, there is significant cost and effort involved with increasing coverage compliance. And once the said coverage is achieved, its assumed the code is good and safe. Testability of code is a whole story alltogether that deserves a post separately, this post targets more of coverage part.
Offcourse 100% is something next to impossible and thats what nobody dares it to ask or enforce. And this gives a margin for 5 or 10% or even 20% and here comes the problem set of problems. Lets deep dive in, consider the following code.
Clean Code is something which seems so simple by names and most of the times something which is ignored and forgiven by most programmers of all ages, but it is one of the most important characteristic of maintainable code. You may be a top shot programmer highly skilled in structures and algos, but if it is not clean, it may end up as junk. Clean code is something which wraps all (yes all) the aspects of modern programming such as various Design patterns, principles etc. But yet, a lot of people forget (or rather ignore). Lets try to understand what it is, and why is it important. For the most part of the code I shall refer c# in this post, but this applies in general to any language, as its a paradigm to general coding practices not specific to any language. Disclaimer: Also, this post may get a little longer and may seem a bit boring, but i would highly recommend reading it. Also, most of the content is what i learned by experience, suggestions and/or comments are welcome.
Brief summary of programmers life
I am in programming for about 15 years, initially as a freelancer, and for about last 10 years, working full time. Have been involved in code reviews and refactoring at multiple levels for about last 6 years or so. Also, i have been following several open source projects and also contributing in my part time. Basically in this post, some of the common issues I found across platforms are highlighted along with why are they important.
Asp.Net Core is one of the gems (I would say) created by Microsoft that has simplified a lot of things and provides a whole lot of things by default out of the box. It based on dot net core which provides inherent capability to run cross platform but to ease out developer life several optimizations were done to enhance productivity.
One such feature is Dependency Injection. Although lately, but Microsoft did included dependency injection as a part of the core product. I have been working Asp.Net MVC since 2010 (or 2011) and started DI with Ninject which was (or is) a wonderful project. During the time I crossed paths with Unity and Autofac during different projects, but more or less the approach remain same. Create a container system, create ‘sort of’ controller factories and then register dependencies. But during all this time one thing that remain constant was additional overhead of creating this shit. So it was a moment of joy (atleast for me) when i say this in recent versions of MVC. And most importantly it is quite stable and performs well out of the box.
With this tool you can load test any SQL Database hitting a given procedure, with test data from a csv. Some of the salient features are given below. When used with Query Store it can help resolve multiple SQL Performance and Bottleneck issues
Can hit any SQL Database.
Dynamic connection check before execution.
Ability to read test data from CSV (details below)
Ability to fetch store procedures from database dynamically.
Support MARS, and both Integrated Security and uid/pw options.
Provide overall metrics viz: Execution Time, Max, Min
Provide metrics per execution which can be logged to a file for further analysis.
Provide detailed logging.
Automatic Handling for multiple resultsets returned.
Download Link provided at the end of post. If you want to cut the long story short, watch the video ab bottom of this page.
I have been looking in the the QuertStore as provided by the SQL 2016 in all features. So I fired up my SQL Azure db and cracked in code, but i could not see any data in there. First thing i tried out, was to run some queries manually, but no luck. On further analysis get to know that you need to have some significant amount of queries executed for it to give some result. For this i got the idea to build this tool.
1minute to readAzure Application Insights provides a detailed Telemetry about the Application during its lifecycle. It can manage all details for application from Exceptions to CPU and Performance Counters.the level of Instrumentation is completely customizable.
In this Podcast, we plan to have a base understanding, with a short demo including the setup and and configurable alerts.
Please ignore the little not so good sound quality issues because of bad mic. will try to fix in next podcast.
32minutes to read readRecently started with TypeScript with Visual Studio for the AngularJs and landed into a deep problem. The problem was that i was on a blank solution/project with no changes, and still there was a build error. The transition was assumed to be ok, but it didn’t turned out. So here are the steps I did:
Create a new MVC project in Visual Studio 2015. Added references for Angular using the PM Console.
Command: install-package angularjs
Install Angular from PM Console
Attempting togather dependencies information forpackage'angularjs.1.5.0'with respect toproject'AngularTestTypeScript',targeting'.NETFramework,Version=v4.5.2'
Once installed, the solution should still compile ok, because as of now there is no TS file in the solution that should be compiled.
Add a .ts file to the project and add a simple function. This would initiate the TSC to come in picture and compile ts bindings.
Now building the solution gives a whole lot of compiler errors and compiler fails. The main errors are TS2304, TS2411, TS2320, . I get around 482 of such errors. The error loig from visual studio is attached below:Continue reading