What's the right amount of test coverage? Test Coverage and Post-Verification Defects: A Multiple Case Study](https://onedrive.live.com/redir?resid=493B8BCE8FC1C3DA!26920&authkey=!AFbVeq8YcyR0jDQ&ithint=file%2cpdf) provides some insights. Interestingly, they find:
that the test effort increases exponentially with test coverage, but that the reduction in field defects increases linearly with test coverage.
In other words, it takes more and more effort to reduce field issues. Based on their study most of the benefit accrues up to around 80% code coverage.
I quote this a lot so here's a link: Tips for Better Online Surveys
1.Every question you ask is expensive.
2.Every question you ask changes the way your users think.
3.Make it easy for the user to bail.
4.Make the questions entertaining and not so serious, at least some of them. Boring surveys deserve the boring results they generate.
5.Don't be afraid to shake up the format.
cURL is a nifty little tool for doing things with the web (like HTTP Requests). It's expecially useful for playing with REST APIs...
A coleague was having some fun calling into the REST API of our issue tracking system. A perfect job for cURL I thought, until I remembered that I was VPN'd on a Windows box from a hotel bar...
Fortunately, the Git windows tool set includes Git Bash which includes... cURL
curl -D- -X PUT --data '{ "fields": {"assignee":{"name":"me"}}}' -H "Content-Type:application/json" https://testserver/rest/api/2/issue/Issue-135
curl -D- -X GET -H "Content-Type: application/json" https://testserver/rest/api/2/issue/Issue-134
to the rescue :-)
(Don't forget -u)
PS: I just stumbled on the fact that Git Bash also includes scp
. What goodness\tm!
A nice commandline tool (based on a Python wrapper for the OneDrive REST API) for working with OneDrive.
pywin32
0. Setup a Python Virtual Environment
1. On Windows, install pywin32
. From the venv use easy_install http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
(with the path to the right pywin32 for your system and Python version...)
2. pip install pyyaml
3. pip install python-onedrive[standalone]
4. Register your app with the OneDrive service (to get the client and secret keys). MSDN details
5. Create a configuration file with the client ID and secret:
client:
id: <client id here>
secret: <secret key here>
- Auth dance
onedrive-cli auth
Then use. For example onedrive-cli ls
to list content stored in OneDrive.
Bonus thought
The OneDrive web service now has some basic Markdown support in the webage text editor, but http://dillinger.io/ is nice too ;-)
A nice little Python Script to send documents to Amazon Kindle via a command line.
(It works too :-)
A quick starter on Python Virtual Environment
Create:
mkdir workingdir
cd workingdir
virtualenv venv
On Unix/Mac OS X use:
On Windows use:
venv\Scripts\activate.bat
Finish:
To move the environment somewhere else:
- In existing (active) environment; grab a list of dependencies with
pip freeze > requirements.txt
- In new (active) environment; install from the dependency list with
pip install -r requirements.txt
To set a specific Python version. On Mac:
- First find the path to the version we want with
which python3
- Activate the environment and run
mkvirtualenv --python=<path to python> <venv>
For example mkvirtualenv --python=/usr/local/bin/python3 myenv
Some Mac Tips...
Copy and Paste
to open the go to dialog, then:
to paste.
Links
Create a link to an application so I can easily run from a shell:
ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Bash
Bash setting are in the .profile
file.
To set a path:
To create an alias to a command:
Then reload the .profile
using the following from your home directory:
(Use ls -a
to show .
files)
Markdown is awesome.
So awesome that there's even a standardization effort to create one common markdown.
Aside
Aside: James asked what the big appeal was. For me it's a plain text format that has built in context with minimal distracting markup. As example:
# I am a title in **Markdown**
\chapter{I am a chapter title in \textbf{\LaTeX}}
<h1>I am a heading title in <strong>HTML</strong></h1>
End Aside
Markdown in Sublime text distraction free mode might be the best authoring environment, but it's far from the best reading (especially for non-Markdown fanatics). Fortunately, pandoc
exists to make conversions between formats easy. For example, to create co-worker friendly documents form .md
files I use:
pandoc -s --reference-docx=reference\reference.docx -o %1.docx %1
Where reference.docx
is a regular OOXML file (from MS Word) that sets up my default styles so that, for example, Markdown regular text uses the Segoe UI Light font family.
Nice.
Reference
There are good cops Simo.
Q.E.D.
The problem:
A set of items in VSO where we wanted the ID as part of the title text.
(It's a long-ish story, but the default VSO board shows only title and assigned to so we adopted a convention of adding the ID to the title text too).
Over time, we'd gathered a number of MVPs on the board where the ID wasn't included. Rather than hand editing, I slurped the query into Excel using the TFS team extensions and ran a little macro to update the items. Here's the code:
Sub fixMissingIDInTitle()
Dim MyCell As Range, MyRange As Range
Dim count, total As Long
Dim sTitle As String
Dim sID As String
Dim iIDLength As Integer
' grab the starting point and then extend to get the range of items
Set MyRange = Sheets("All MVPs").Range("C3")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
total = 0
count = 0
' iterate over the range
For Each MyCell In MyRange
sTitle = MyCell.Value
sID = MyCell.Offset(0, -2).Value
iIDLength = Len(sID)
If (Left(sTitle, iIDLength) = sID) Then
' do nothing - ID already at start
' Q: but is it the right ID?
Else
MyCell.Value = sID + " - " + sTitle
count = count + 1
End If
total = total + 1
Next MyCell
MsgBox ("Updated " + CStr(count) + " of " + CStr(total) + " items.")
End Sub