I am working on a UI to to display a test to the user. I would like to display where it is defined. For example:


Given <this condition>
When <I do this>
Then <I should see this>

What is the most user-friendly way to do this? Is there any sort of standard? I often see /path/to/file:line_number, but is there a better way to do it? Maybe something line /path/to/file, line <line_number>? Or /path/to/file @ <line_number>? Or something else?

Also, is it clear enough that the file and line number is where the test is defined, or should I have something more obvious, like "Defined at /path/to/file, line ???"?

3 Answers 3


If possible, give your users a hyperlink using named anchors instead of mentioning in plain text where he/she should go.

But if it has to be a plain text, /path/to/filename:line_number is clear if what we are reading as "line_number" is also read as line number by the user. For example:


Here, :42 is not clear that this is line number. If it was written something like:

C:/windows/folder/filename.txt (Line-Number: 42)

then this would do the job.

Avoid using @ or anything new other than convention as every symbol has a meaning and you might end up creating a confusion instead of help.


To an extent it depends on your users. Here's what I'll assume: 1) Your users are highly technical. Probably software engineers. 2) You're showing this output in order to direct this person to debugging activities. 3) This is not being used to simply generate a message or action item for anyone other than the User viewing it.

If my assumptions are correct then I might recommend the following:

37: <% this is %> <% some of my code %> <% on line 37 where the problem is %>

This is important in helping the user maintain mental context throughout this process. Rather than navigation among multiple screens/tabs/apps/displays they get the benefit of context right in their core display (web browser, whatever).

The other suggestion I might add is to include the preceding a following 2 lines, if it makes sense for your use case, to help establish just a bit more context around the line in question.

  • @iBelieve It certainly depends on your users and I would like to add to this answer that if the users are not technical, telling your user 'to go find it themselves' (because that is basically what you tell them to do, find something at a certain location) is a bad idea. In this context I don't see why you shouldn't give the users a direct link. Jan 8, 2014 at 9:50

As Matt said I think it depends on your user, if he has a technical background or not.

Developers and engineers knows what they are doing and what is an error so there is no point bothering them with useless informations/phrases. In this case, I think the syntax /path/to/file:ln is ok. They want to do their job quick and well.

Otherwise, if you're designing for non-technical users (or if you can't know what is their technical level) it's probably better to be friendly. Something like "There is an error in the file /path/to/file at line 32. The software has been shutdown to prevent damages on your datas." Well this is pretty long and maybe too much but you get the thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.