Tommie 的个人资料: : Tommie照片日志列表更多 ![]() | 帮助 |
|
|
To Sergejus I got a message from the user Sergejus, but his personal Live settings won't let me reply to him. Therefore I hope he reads this blog instead as an answer to his mail. Sergejus wrote: Hi Tommie,
Some time has passed since your last post, but currently I'm
trying to write custom adapter for external DB. Because you've done you
MSc, could you please share source code or at least provide some
snippets for connecting to external DB and pushig data from it to TFS.
Thanks,
Sergey My answer: Hi Sergey! You can find our final report with all code we produced in our master thesis document, at this address: Feel free to read, spread and use the information held in our report - as long as you give credit where credit is due and don't alter the content. Good luck with your work! Best regards, Tommie Finally an updateI know I haven't updated the blog in a while. That's because nothing interesting really has been happening. The last couple of days have been dedicated to write the master thesis report - and we're almost done with the theoretical part. Regarding the implementation, I've got the Adapter + the XML schema left to do. I'm not sure how far Magnus has proceeded at the client part and the Excel reports, but I think it's going well. I know he's been able to produce an add-in package to Visual Studio which adds a meny item, from where you can communicate with our webservice to send the code metrics. I'll get back to the blog as soon I've got some interesting news. Just wanted to assure you that I wasn't dead or slacking off ;-). Inserting automatic timestamps into the databaseAfter some search I've found the way to do it:
Now everytime you insert a record into the database, the timestamp will be generated for you. To get the SQL-thingy going...Now, I've managed to create my own database in my Solution in VS, created some (preliminary) tables, and I got it all working on my XP machine. But then we have that thing about transferring it to the VPC to get it to work in Windows Server 2003. Not so easy as I thought. First of all, let's talk about my tables. This is just a preliminary design, but I think we will keep it somehow intact:
This table is called "SavedEntries". Everytime someone evaluates code metrics and sends the result to TFS, a new row will be added to this table in the database. ID is the primary key, ProjectName (or whatever ww in the future will choose as an artifact) will hold artifact-information. TimeStamp stores time and date for when the metrics were performed. We will perhaps need to store more attributes, so it is possible to extend the table with more columns.
This table is called "MetricsData". It speaks for itself. ID is the primary key for the table, EntryID is a foregin key mapped to SavedEntries.ID (see SavedEntries table above). The meric reults are stored in his table. That was the tables. Now to my problems. I've created a new SQL Database called CodeMetricsDB.mdf and it is stored in the App_Data folder (together with its CodeMetricsDB_log.LDF file). It works fine on XP with the following connection string:
However, when I transfer the webservice files to the VPC for TFS, I get a severe exception. After some search on the net I found that it is probably the attaching of the CodeMetricsDB.mdf file that makes it all go to hell. Mr. König helped me out a bit by telling me that I shouldn't use SQLEXPRESS but instead a "real" SQL server, and attaching the database by using some database tool. The problem is that I can't find any tool (or other way to do it) on the VPC. And even if I use the Server Explorer inside Visual Studio 2008, when I try to add a new connection, all I can choose as server is ORCASBETA2_TFSV\SQLEXPRESS. Why? Shouldn't I be able to choose some "non-Express-SQL-server"? I'm really confused. So I'm stuck again, with something working on XP but not on the VPC. And I don't know if the Integrated Security + User Instance in the connection string is a wise thing to do. Perhaps I should use SQL authentication instead. But then again, I need to find some way to add users to the SQL server databases (which I don't know how to do in the VPC). One positive thing is that I at least know how I should read information from the database usin C# (same connection string [conn] as above - it works on my local computer but not on the VPC):
Lines 15-17 performs the reading operation. Everytime myReader.Read() is called, it consumes one row of the results returned from the SQL database. (In the above examples, it returns a string containing all ProjectNames stord in the SavedEntries table, separated by four dots). I'll have to figure out how to solve this XP <--> VPC problem. As I've tried so far, developing on the VPC instead doesn't seem to help me at all. I'm pretty sure that it all will work fine if I could figure out a way to (1) attach the database to the SQL Server in the VPC and (2) create a correct connection string for the scenarioa in (1). Connecting to the TFSI managed to make a short program which connects to the TFS Server and extracts information from it. The program is written in C#, and is not really hard to make. I'm not sure though if that's the right way to go. I know that I can implement some C# code in my webservice, but it's still not clear to me if I should connect to TFS this way or another. Anyway, I do it like this, in a simple C# console application (yes, it is from an article at MSDN - I just don't remember the source right now):
It works fine, I've tried it on the TFS VPC. But as I said, I'm not sure that I'm on the right track here. Perhaps webservices that are to be a part of TFS should communicate in some other way with the server. I'll have to study some more. Please do give me some feedback on my thoughts! I did it! WCF Conquered ;-)Found this
excellent example on how to
implement a simple web service (explained step by step on this blog). It helped me a lot to understand how I am
supposed to do. And, amazingly, I got it working! I’m so overfilled with joy right
now I don’t know what to do. I’ve spent almost all day figuring out how to use
WCF and configuring IIS to get around all possible types of error messages –
and finally, it worked.
Now, there are obviously more things to do. First of all I need a client which sends the code metrics data to the web service (I did implement a simple client, but Magnus is taking a deeper look into making a client via a package for VS 2008). Secondly, the web service needs a method that receives these code metric data and finally forwards them into the Data Tier on TFS. I know how to construct a method that receives the data. Now I need to concentrate on two primary things regarding the web service:
Extending TFS continued (and more...)It's been a
while since I wrote something here, so I think it's time I'll give you all an
update on what's going on in the project.
Well, time to get some work done. Over and out! Extendning the TFS data warehouseI've been reading some material on how you could extend the TFS data warehouse, and it definitely not a trivial task. As far as I've understood we will have to implement our own operational store (Microsoft SQL Server 2005?), whereafter we implement an adapter. This adapter serves as the interface to the TFS data warehouse and transforms our data so that reports could be generated from these data in the future. Although, I am wondering if it isn't possible to use existing operational stores to use a new adapter on? It isn't really clear, and with the lack of books which collect all this important information in one single place, it's really hard to get an overview. There are 5 existing operationl stores as of now:
But you do really only need to create an adapter if you're adding new data types to the warehouse. I can see no other option than doing so if we are to save code metrics in the warehouse. Code metrics is (or rather I think it probably will be) a new data type for the data warehouse. Do correct me if I'm wrong. So if I am correct in my assumptions (further studies have to be made, I'm not 100 % sure on these things) the tasks that lie ahead of us are to define and implement an operational store and an adapter for that store. The last step will be to utilize these new data in the data warehouse by designing a report which uses these code metrics. Of course we first have to implement a tool in the client (VSTS) to have something to save into our operational store (also a part of our original assignment). I will have to read some more about extending the data warehouse in TFS before I am totally sure on how we should proceed. Some useful links: IWarehouseAdapter Interface Implementing an Adapter How to: Create an Adapter Understanding the Data Warehouse Architechture (good diagram of the architecture on this page) Data Warehouse Extensibility How to Extend the Data Warehouse Database Reading tips are greatly appreciated! I will continue tomorrow with my investigation. Feels like I'm on the track of something here at least. Hopefully it will not show to be a dead-end. Status updateYesterday we had a Live Meeting with Dag König and Nils Stadling. I thought I'd just summarize what we concluded from the meeting: Software metrics were defined together with the conecpt of code metrics. It is code metrics that are of a particular interest (in contrast to software metrics, which includes measurements on documentation, requirement specifications, use cases, etc). Mr. Stadling is going to investigate which types of projects are most common when developing with Visual Studio Team System and Team Foundation Server, together with some kind of contact list from where we will be able to do some empirical research. This means that it is possible that we will deviate from our original description of our project. The task will be the same, but the prerequisites and delimitations will probably differ (no longer from a project managers perspective - probably rather from a Developer Managers perspective, or some similar role). We will, although, still implement some code metrics in VSTS and then implement these metrics in TFS. The books were on the way, and I hope we will get them soon. Until we get them though, I and Magnus will dig deep into the Visual Studio SDK for the 2008 Beta to learn exactly how you can extend the Data Warehouse to our needs. Also, we will probably have some looks at VisualStudio Extensions home at CodePlex and the Visual Studio Extensibility Forum on MSDN. On monday (October 8th) we will have another Live Meeting with our supervisors. Until then we hope that Mr. König has some news about the code metrics utility in the VS 2008 client. As for our task, we should've come up with a solution on how to extend the Data Warehouse in TFS. If you do have suggestions on how to do it, or have some suggestions where to search for information - please do let me know. If you want to se our PowerPoint slides, please do have a look at it here. Feel free to use it as you wish, as long as you don't change it. I won't waste any more time here now, it's time to check out the VS 2008 SDK and start searching for solutions. I'm going west, the project is going well.These days I've been reading three previous master theses on the subject of Software Metrics: "Mätetal för mjukvaruutveckling - Framtagande av ett mätprogram på Ericsson Business Networks AB" (Translates to "Software Metrics for Software Development - Developing a Measurement program at Ericsson Business Networks AB"), "Tillämpning av Software Metrics på objektorienterade system - En studie och ett praktikfall" (Translates to "Application of Software Metrics on Object-Oriented Systems - a study and practical case"), and finally "A Study of Software Metrics: Choosing a Relevant Set of Attributes for the Measurement of Software Quality at Tandberg Data A/S". I must say that I really didn't learn much new - mostly I just got my previous knowledge confirmed. Nevertheless, there were some useful tips on how to choose relevant quality factors. Maybe not so much with a specific role in mind as I had hoped, but it was hopefully useful knowledge anyway. I've also been watching some of the few on-demand webcasts that I had left. Can't say that I really learned something useful (for our project) there either - most of them were just repetition of what've been said before in previous web-casts. Got some other good news though - probably we have two project managers at IFS that can assist us in our empirical research. Magnus has more information about that part. We've also put together a powerpoint presentation and installed the Live Meeting client, so all deliverables are prepared for the meeting on monday with our supervisors on October 1st, at 1600 hours. I'll be in Norway during the weekend to visit some relatives, and I'll get back sometime Sunday evening. So I won't be able to answer emails or calls. Over and out! Quality factorsAs I stated in a previous post, our first "mission" will be to find what quality factors that are relevant to a project manager, managing a software engineering project using the MSF Agile process model. But what is a quality factor? A quality factor is a key attribute of the software, normally high-level external attributes. It is these attributes that constitue the quality of the software product from the users perspective in the end. The quality factors are determined by dividing them into some criterias which are relevant for that quality factor. Each criteria is measured and quantified by some kind of metric(s) (there is a possibility that several metrics contribute to one criteria). An example is in place. Let's look at the quality factor Maintainability. Maintainability can be described by three criterias; Correctability, Testability and Expandability, where:
Other quality factors than Maintainability that could be mentioned are e.g. Usability, Integrity, Efficiency, Correctness, Reliability, Testability, Flexibility, Reusability, Portability and Interoperability. Each of these are then defined by some criteria, which in turn are measured (or quantified, if you prefer that term) by using some metrics. The ISO 9126 standard suggests there should be only 6 quality factors depicting the quality of a software product. These quality factors are:
As you can see the quality factors are high-level descriptors of software quality. With the constraint on the context for our investigation, we will have to find both theoretical and empirical guidelines of which quality factors that are relevant. As of today we have one software project manager confirmed who (hopefully) will be able to help us out with some real-life experience on these topics. But other than that, we mostly rely on Microsoft to provide us with willing customers who are using the MSF Agile process model. And another thing Magnus and I discussed today is how much the process model really affects the results. Do a project manager leading a project under the MSF Agile process model prioritize different quality factors than those leading a project under the, say, RUP och waterfall model? We're not confident that this variable will have such a great impact on the conclusions to be drawn. More to come later on... things to do...
What are Software Metrics?After reading some literature on the subject (including research and conference papers), Magnus and I have tried to extract the important parts. Here, I'll try to recap what conclusions we've agreed upon. Definition of Software MetricsThere are several ways to define software metrics, but all definitions more or less say the same thing. For example, we have found these quotations regarding the definition of Software Metrics:”An objective, mathematical measure of software that is sensitive to differences in software characteristics. It provides a quantitative measure of an attribute which the body of software exhibits” “Software metrics measue specific attributes of a software product or a software-development process. In other words, they are measures of success.” “An attempt to quantify some aspect of a product generated during a software project.” (Note: product could mean source code as well as documentation) ”A measure of some property of a piece of software or its specifications” NASAs definition: “Software metrics are measurements of software attributes. For example, Total Lines of Code is a measurement of the number of lines of code (executable statements, comments and blank lines) for a given module.”' Our conclusion: Software Metrics are measurements, a quantification of an attribute that an artifact in a software project possesses. The purpose of Software MetricsSome quotations found:”Software metrics are computed for the purpose of evaluating certain characteristics of the software developed” “[Software metrics are] indicating how well the software is designed and coded according to measurable quantifiable criteria. This is where “metrics” fit into software quality assurance. They should relate to software quality “attributes” or “factors” of interest acknowledged by the community of software developers and users.” “Software metrics are used to obtain data to support the software goals for the project, for the divisions and, ultimately, the business goals of the corporation.” “Metrics data collected during the project track the status and progress of the project. These actuals are compared with the estimates to indicate and avoid problems.” “A goal of software metrics for the projects is to provide data to management for controlling software development” “As applied to the software project, a software metric measures (or quantifies) a characteristic of the software.” “You cannot control what you can’t measure”
"Measurement
is important for three basic activities: Understanding, Controlling and
Improving."
We also found out that the purpose of the metrics differ depending on the role you have in a software project. For managers, the metrics serves the purpose of answering questions like:
Classification”Software metrics and Software metric attributes are classified into three broad categories:
NASA classifies their metrics with regards to object-oriented languages and non-object-oriented languages. Furthermore they have additional categories of metrics, such as Halstead metrics, complexity metrics, requirement metrics, error metrics and miscellaneous quantitative metrics. Another article suggested that it didn't exist any metrics to measure data or information. The article also stated that there isn't any good metrics for measuring software/hardware hybrid projects. We haven't dug any deeper into the subject to see if this was correct or not. It may be the case that new metrics on these areas has been developed after the publish date on that article. Pfleeger & Fenton mentions three classes to measure software in:
Conclusion: Software metrics can de divided into three main categories:
Requirements on Software MetricsThe information provided by the metrics must satisfy three conditions to be of relevance to the project manager (so he can make the right decisions). The metrics must:
Conclusion: (Those stated above). Examples of software metricsHere are some examples of software metrics: etc. It should be noted that e.g maintenance is not a software metric. It is a quality factor. That's it! No office at the university, but progress nevertheless!This morning we had a meeting with Sandahl, our supervisor at the university, and discussed the master thesis part of the project. The question the thesis will try to answer will be formulated as: "What software metrics are relevant for a project manager developing a project according to the MSF process model?" The first part of this will be to determine what software quality factors are relevant in the specified context ( {role: project manager, model: msf agile, [probably some other constraints added during work progress]} ). When the software quality factors have been determined, we have to find ways to measure them. This will be the part that will be covered in the master thesis. However, the other 3 steps (implementation in VSTS, implementation in TFS and implementation of the dashboard) will follow directly. Prototypes of the implementation will be developed parallell to the investigation to save some (calendar) time. We will not get an office at the university. All offices were taken, and undergraduate students weren't prioritized when assigning offices to staff. This will imply some practical problems for Magnus and me to do our work, especially when the implementation phase will start. But I'm sure we'll manage it somehow. A possible problem we see right now is that we perhaps will have some difficulties performing an empirical investigation. We would love to question software project managers in the industry today (and perhaps we could get some help from Microsoft) - we feel it is a necessary part of the investigation. We are afraid, though, that it will be both difficult and cumbersome to find people willing to participate in our investigation. However, we did get some names Sandahl suggested we should get in touch with. Magnus is working on that part right now. We've ordered some previous master thesis from the library on the topic of software metrics, which I think will prove to be useful for our work. The task to try to define what we mean by software metrics is almost completed. I've completed a draft which i will publicise soon on this blog. It still has to be reviewed by Magnus. Short updateI really don't have any exciting things to report, just thought I'd give a briefing of todays work. I've been reading more of the IEEE articles about software metrics and printed down some of my findings, like a mindmap. The map will need some more structure before I post it here - so far it's just a draft. I gave the VSTS/TFS literature question a thought and have come up with some titles I think will benefit med and Magnus in our work. The list of books was sent to Magnus earlier this evening, and now we will sync our lists and then send them to Nils so he could order the books for us. We will have a meeting with Mr Sandahl on Friday morning to discuss the master thesis part of the subject. Hopefully we will be able to combine the Microsoft work with the master thesis without having to do so any unnecessary work. Tons of papers to read, but no books :-(Magnus and I were at the university today with two tasks in mind; first of all to find some papers on Software Metrics (especially IEEE publications), and secondly to see if we were able to find some of the books that Dag showed us at the meeting the other day. We searched the university library, the local library in Linköping and even the local library in Norrköping - but none of the titles listed in my literature list (or those listed in an earlier blog post) were to be found. So we have to rely on Dag or Nils now to provide us with VSTS/TFS reading material. We've done what we could. The day was not a total waste though. We managed to print loads of (and I mean loads of) IEEE papers on Software Metrics. This evening I've spent most of my time reading about NASA's Software Metric Program, their definitions and evaluation methods and so forth. There were a lot of exciting papers which will be read before friday. among them are titles such as "Coordinate Metris and Process Model to Manage Software Project Risk", "A Software Metrics Program", "Software Metrics - An Introduction", "The danger of using axioms in software metrics", Re-planning for a Successful Project Schedule", "Metrology, Measurement and Metrics in Software Engineering", "Metrics for Managing Customer View of Software Quality", "Experiences of collecting and using Software Metrics in Industy", "An Empirical Study of Software Metrics", and so forth. The list could almost go on forever. Of course I will publish a list of all relevant papers with title, author, etc. But not tonight :-) These paper will serve as a scientific foundation to base our definition of code metrics and its use on. Hopefully we will have something concrete to report soon. I've set an internal deadline for myself to finish reading these papers thursday evening, and come to some personal conclusion (which I will then discuss with Magnus so we could unify our separate results). Briefing from the meeting with DagThe meeting I and Magnus had with Dag König today was very rewarding. I feel like it's much more clear now what our objectives with the project are (and thank you Dag for the sweater I'll try to summarize the meeting. Dag showed us some books, and we got to look through some of them. We will try to find the titles in the university library tomorrow, and hopefully we'll have the chance to borrow them there. If that's not possible, Dag or Nils could probably supply us with the necessary titles. We tried to narrow down the type of software project to have in mind when evaluating software metrics. We concluded that we will only look at projects developed using the MSF Agile process. The project leader of a software project will be the role we will primarily have in our mind when evaluating the metrics. Developer will have a secondarily priority as target readers of the metrics. We discussed if size, design (method, patterns, etc) or type of application must be further delimited. No decision was made upon that point, so the future work will show if we have to specify these attributes or not. Dag also presented his visions and what he would like to have as an endresult. We concluded that the work could be divided into four parts: 0. Define what we mean with code metrics Here we must define the terminology so we all agree on what we are going to look at. This is a very important part, and we will present a conclusion before October 1st, 2007. 1. Analyze and fiind relevant code metrics At this point we will (with the restrictions on project type and role mentioned above in mind) find out what metrics that are relevant to use. If the metrics isn't already implemented in VSTS, then they will be. Exactly how this is done was discussed during the meeting. Probably we will have to write our own Add-in to VSTS. Another option is to extend the now available code metric tool, but we do not now how complex that solution would be (or if the tool is extendable at all?). 2. Implement in TFS When we have our relevant metrics in VSTS, we will implement some type of functionality in TFS which allows saving code metric data in the data warehouse. This allows for reports regarding code metrics to be generated, and it will be possible to see some history and progress (regarding the metric values of the project). 3. Implement a Dashboard This is just an extension of point 2 above. The purpose is to make some kind of quality indicator in the project portal, where even people outside the project (investors, customers, etc) are able to see the progress and current quality level of the project. Some other thoughts expressed during the meeting: Our objective could also be to analyze what the existing code metrics are saying about the quality of the project. Then decide what you should do about it to improve the stats. In this part it is also important to define what depicts good (and bad, respectively) numbers. The Code Analysis engine could probably be used somehow to implement some kind of code metric. The same engine could also be used to enforce policies for checking in code (which then should be based on some kind of code metric). Code metrics for SQL was an interesting subject, which would mean that we would have to take a deeper look on the Database Professional edition of VSTS. We would like to perform some kind of empirical investigation - interviews, visit the industry and perform studies, etc. We hope that either Microsoft or the university (or both!) could assist us in finding subjects for interview. If the interviews are performed live or via phone, email, or other media doesn't really matter. We would just like to complement the theory with the practical reality. We will have 14 days to conclude the first point mentioned above (point 0.). At the 1st of October, 1600, we will have a Live Meeting with Dag (and hopefully Nils too) where we will show what we have concluded. Of course I will hare the results with you readers of my blog too. Of course we had discussions about a bunch of other stuff, but these were the relevant parts (please do remind me if I missed something essential, Dag and Magnus!) My TODO-list:
Over and out. Labs on VSTS/TFS and some other stuffThese days I have been taking a look at the labs for VSTS. I installed the 2008 Beta 2 version of VSTS and managed to do one of the labs with ease. I wish although that I had the opportunity to do the lab on VSTS reports, that one requires you're running Windows Server 2003 (unless running VPC). I did, though, download and install the VPC software, but the large files required for the VSTS/TFS image took too long to download (still hasn't finished! An average rate of about 50-70 kB/s isn't really satisfying), so I haven't really had the chance to experiment much with that part. Anyhow. Tomorrow Magnus and I will be going up to Stockholm to have our meeting with Dag. We've prepared some questions and other things we want to straighten out. Last days have had a real hard focus on learning VSTS/TFS. Now we have to concentrate (at least in a wider sense than before) on the master thesis and the software metrics to investigate. We've had that part on hold until the meeting tomorrow, so hopefully this part will accelerate some during the upcoming week. It has to. Work plans for the weekendThe Ambassador meeting in Stockholm with Nova100 yesterday was a success. I had a really good time and it was nice to get to know all the people I will be in touch with during my active year as the ambassador in Linköping. Got home really late yesterday, so it has been a slow start for me today. Anyway, I've viewed all the tutorials at teamsystemrocks.com, and I feel I've an even better understanding of the system now. I will have to spend most of the weekend with virtual labs on VSTS/TFS and reading some more about Software Metrics, so I will be prepared when meeting Dag on Monday. Also, Magnus and I will get together sometime during the weekend to summarize all our questions we have for Dag. The TODO-list:
I hate making up headlinesIt's always so hard to make headlines interesting. Anyway, just an update of the work that has been going on since last post. We've revised the Vision & Scope document and sent it to Dag. It was kinda hard to fit all information on just one page, since we didn't really know what parts were mandatory. With that said, we took the parts that mattered most for ourselves and our work. I hope it looks okay now. I've set up a study list which you will find on the right side of my Live Space. It is not complete and will be expanded as the work proceeds. The last two days I've been studying some video tutorials showing features and how-to's regarding VSTS/TFS at teamsystemrocks.com. I've almost looked through all of them (I have about 6-7 left to watch) and I must say they've been very educational. They have given me a better comprehension of the system, although I feel we have to dig even deeper to be able to carry out our implementation. I will be away in Stockholm tomorrow for the whole day (11.00-21.00) to attend an ambassador meeting with Nova100, so I won't be able to get any work done during thursday. Which means I'll just have to put in a hell of an effort on Friday. And saturday. Also I'm looking forward to having the meeting with Dag on monday. Feels like a lot of loose ends will be resolved after meeting Dag. So, my TODO-list:
Ciao! |
|
|