[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: Layout, first paragraph bottom position fix
From:       "Thomas Zander" <zander () kde ! org>
Date:       2010-09-21 15:38:01
Message-ID: 20100921153801.23614.22476 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 2010-09-10 15:41:36, Thomas Zander wrote:
> > Please provide a unit test to show the problem.
> 
> Thomas Zander wrote:
> Thanks for explaining how to load a document and see it fail; this is black box \
> testing and useless for regression testing or showing the actual bug in the code. \
> Please provide a unit test to show the problem. 
> Pavol Korinek wrote:
> To simulate this problem I had to combine tests for application \
> (KWTextDocumentLayout) and pluggin (Layout.cpp) which means don't write test for \
> some unit or function, but test for whole layout. It's not possible to mix them \
> also, because they are invisible one to each other. Also to create Mock object of \
> KWTextDocumentLayout or Layout.cpp for this test is not possible, because part of \
> functionality which I need is connected to so many other fuctionallity, that it's \
> not possible to cut some. At least if I was successfull with this test, and had \
> sucessfull simulation, than run of such test, was like run application with test \
> data and check output. I suggest more people to check KWTextDocumentLayout logic \
> and check if firstParagraph boolean value, should be set to true, when new shape \
> comes into play.

The Layout plugin and the KWTextDocumentLayout are indeed two separate units, and \
should be tested separately.  This is possibly by defining the interactions between \
the two and figuring out what you expect to happen which doesn't happen right now. \
After defining the interaction and deciding which of the two sides is buggy (either \
the provider of the API or the user of the API) you write a unit test based on that \
conclusion; you either write a test that tests the provider of the API or you write a \
test testing the consumer of the API.

In your explanation it seems you don't have a clear picture yet of the contract of \
the APIs since you say you need both at the same time. That may be a good place to \
start.

Also, I think there are various partners listed on the Qt website that provide \
training for writing unit tests, if you and your company lacks that knowledge please \
consider contacting them. I'm have to be honest in that I don't really have the time \
to explain those concepts in my spare time, for free, to a for-pay subcontractor.


- Thomas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5305/#review7526
-----------------------------------------------------------


On 2010-09-13 07:19:03, Pavol Korinek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5305/
> -----------------------------------------------------------
> 
> (Updated 2010-09-13 07:19:03)
> 
> 
> Review request for KOffice.
> 
> 
> Summary
> -------
> 
> We use shape (m_state->shape) height to set 'end bottom position' when first \
> paragraph occurs. When m_state->shape is new one, then we should set new 'end \
> bottom position'. It can be done by set firstParagraph to true on new shape. This \
> was investigated to solve: https://bugs.kde.org/show_bug.cgi?id=239703 
> 
> Diffs
> -----
> 
> /trunk/koffice/kword/part/frames/KWTextDocumentLayout.cpp 1172979 
> 
> Diff: http://svn.reviewboard.kde.org/r/5305/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Pavol
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/5305/">http://svn.reviewboard.kde.org/r/5305/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On September 10th, 2010, 3:41 p.m., <b>Thomas \
Zander</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Please provide a unit test to show the problem.</pre>  </blockquote>




 <p>On September 13th, 2010, 8:44 a.m., <b>Thomas Zander</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks for explaining \
how to load a document and see it fail; this is black box testing and useless for \
regression testing or showing the actual bug in the code. Please provide a unit test \
to show the problem.</pre>  </blockquote>





 <p>On September 17th, 2010, 1:42 p.m., <b>Pavol Korinek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">To simulate this problem \
I had to combine tests for application (KWTextDocumentLayout) and pluggin \
(Layout.cpp) which means don&#39;t write test for some unit or function, but test for \
whole layout. It&#39;s not possible to mix them also, because they are invisible one \
to each other. Also to create Mock object of KWTextDocumentLayout or Layout.cpp for \
this test is not possible, because part of functionality which I need is connected to \
so many other fuctionallity, that it&#39;s not possible to cut some. At least if I \
was successfull with this test, and had sucessfull simulation, than run of such test, \
was like run application with test data and check output. I suggest more people to \
check KWTextDocumentLayout logic and check if firstParagraph boolean value, should be \
set to true, when new shape comes into play.</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The Layout plugin and \
the KWTextDocumentLayout are indeed two separate units, and should be tested \
separately.  This is possibly by defining the interactions between the two and \
figuring out what you expect to happen which doesn&#39;t happen right now. After \
defining the interaction and deciding which of the two sides is buggy (either the \
provider of the API or the user of the API) you write a unit test based on that \
conclusion; you either write a test that tests the provider of the API or you write a \
test testing the consumer of the API.

In your explanation it seems you don&#39;t have a clear picture yet of the contract \
of the APIs since you say you need both at the same time. That may be a good place to \
start.

Also, I think there are various partners listed on the Qt website that provide \
training for writing unit tests, if you and your company lacks that knowledge please \
consider contacting them. I&#39;m have to be honest in that I don&#39;t really have \
the time to explain those concepts in my spare time, for free, to a for-pay \
subcontractor.</pre> <br />








<p>- Thomas</p>


<br />
<p>On September 13th, 2010, 7:19 a.m., Pavol Korinek wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KOffice.</div>
<div>By Pavol Korinek.</div>


<p style="color: grey;"><i>Updated 2010-09-13 07:19:03</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">We use shape (m_state-&gt;shape) height to set &#39;end bottom \
position&#39; when first paragraph occurs. When m_state-&gt;shape is new one, then we \
should set new &#39;end bottom position&#39;. It can be done by set firstParagraph to \
true on new shape. This was investigated to solve: \
https://bugs.kde.org/show_bug.cgi?id=239703</pre>  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/koffice/kword/part/frames/KWTextDocumentLayout.cpp <span style="color: \
grey">(1172979)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/5305/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic