Calvin Hsia's WebLog

thoughts from a professional developer

Browse by Tags

Tagged Content List
  • Blog Post: Scan the Windows Event Log for your application crashes and hangs

    When you write software that runs on someone’s machine, it might crash or hang. If this occurs, there are ways to see if this occurred from your program. For example, I wrote a simple application in C++ called CppTest that crashes by dereferencing a null: char *ptr = 0; *ptr = 0; Lo and behold: my custom...
  • Blog Post: Use Custom Attributes to initialize test environments

    Some tests can be quite complex, perhaps having prerequisites that consist of various steps, querying initial conditions, loading test data, etc. You can use Attributes to specify various test configurations. The sample below shows how to create your own attribute class and how to retrieve and use it...
  • Blog Post: Create a logger for watching your test progress as it runs.

      I was creating a project that’s a Windows Service, which has components running in multiple processes, using multiple threads and named pipes for communication. To understand the behavior of the code, I wanted to have accurate logging that: · The timing was very critical, so I wanted the log to...
  • Blog Post: Turn your tests into stress tests easily

    It’s great to be able to write tests and execute them while developing a project. While I’m developing, I can hit a button and run the dozens of tests to see if I’ve broken anything. As code gets written lots of things get refactored, moved around, etc. Hitting a button to see if I broke anything is...
  • Blog Post: Increase the memory available to your tests

        I love having test projects included in my solutions. Software is alive. I’m constantly making improvements/changes/fixes. When I have customers asking for various features in my code, or for code improvements, being agile and able to publish a changed build with utmost confidence relies...
  • Blog Post: Automatic tests protect your code

      Last month   in   Dynamically create huge tooltips in WPF TreeView and ListView I showed some code that creates large tooltips to present lots of data.   Today, we’ll talk about creating automatic tests for this feature.   Testing User Interface features has been difficult...
  • Blog Post: Dynamically create huge tooltips in WPF TreeView and ListView

      Tooltips are useful. When the mouse hovers over a button a tip can indicate what happens when it’s clicked. The mouse move does not actually invoke the button, but can give information in a passive way.   Sometimes I want to make huge tooltips. This essentially gives more screen real estate...
  • Blog Post: Persist user form size and location settings per session

    My prior post ( Create your own Test Host using XAML to run your unit tests ) shows how to create a form and present it to the user. The user can resize and reposition the form, even on a 2 nd monitor. When the user exits the form, we can persist or remember the form size and location, so the next...
  • Blog Post: Create your own Test Host using XAML to run your unit tests

    A few days ago, somebody came into my office and plopped down a box. It seemed very light. He said that it was a new PC. I thought hmmm…. The box seems empty…Why am I getting a new PC?. Apparently an inventory was made and my current hardware was at the lower end of the list. So I started up...
  • Blog Post: Find the Executing function's name

    Often I want to write the SAME code that will display the name of the currently executing method or function. That way I can just copy/paste the same code into multiple methods. For example, in sub Form1_Load I could put this line: System.Diagnostics.Debug.WriteLine( "in Form1_Load" ) ...
  • Blog Post: Use Visual Studio Test framework to create tests for your code

    While writing software over a period of weeks or months, various components of the software get completed at various times. You’ve tested and you’re satisfied they work, and you move on to develop another feature. Or you might check in the source code and somebody else on your team might break your code...
Page 1 of 1 (11 items)