MohamedG's Log

TW9oYW1lZCBFbC1HZWlzaA==

Tiny C++ Unit Test Framework

I was working on a small project for personal use that I wrote in C++ and I wanted to test it. Since it’s a tiny project, I didn’t bother installing a well-known test framework that ships with a plethora of features. I just wanted a simple test runner that can show me a failure when… Read more

On Testability

Acceptance testing is basically black-box testing done by the QA team to sign off. It’s very important to have clear pre-defined goals for acceptance testing as early as possible during the planning phase. In fact, the requirements specifications should define negative scenarios and expected failure behavior, not just positive scenarios and use cases. These requirements… Read more

How to: Debug Deadlocks Using Windbg?

Attach the debugger to the process Load SOS ~* e !clrstack to view the CLR stack of all the threads and where they are Look for System.Threading.Monitor.Enter(System.Object) in the top frames Load SOSEX.dll from http://www.stevestechspot.com/SOSEXUpdatedV11Available.aspx !dlk to detect deadlocks. The output looks like the following: Deadlock detected: CLR thread 5 holds sync block 0018f05c OBJ:010d909c[Microsoft.Sample.SampleEvent]… Read more

Test Patterns

Just like design patterns, the use of test patterns will make your life easier. A lot of the common testing methods can be reused. Along with the benefits of reuse, using patterns makes it easier to explain to others what you are going to do in a word or a two instead of telling the… Read more

Windbg

Using Windbg, aka Debugging Tools for Windows, is a great way for debugging, crash analysis, and reading dump files. If you’re not a keyboard person who likes to write commands and be in the driver’s seat, you might not like it at the first glance, but after using it, you’ll appreciate its power. To give… Read more

!exploitable

!exploitable is a crash analyzer plug-in for windows debugger (windbg) that does post-mortem analysis of a crash and assists its security risk, very cool! The project is licensed under Microsoft Public License (Ms-PL) and you can download it at codeplex. The analyzer rates the crash one of the following ratings: Exploitable, Probably Exploitable, Probably Not… Read more

File System Limits

When you create a file or a folder, do you check that the full path is not too long?! Make sure that you handle the PathTooLongException:     Try to exceed the maximim lenght on Windows, and you’ll get this error:     Here are some limits in Windows APIs that you should know about:   #define MAX_PATH 260… Read more

Pseudo-localization

It’s an economic need to develop international software as you need to reach as many customers as possible all over the world. Let’s tackle a simple scenario, imagine that you will develop an application that has a bilingual UI: English and Arabic. It’s very easy to develop everything in English, but what about Arabic? When… Read more